dsandor / fauxmojs

Fake WeMo device ported to NodeJS. Allows Alexa (Amazon Echo) to make api calls.
56 stars 22 forks source link

Add new devices after initialization. #3

Closed jaretburkett closed 6 years ago

jaretburkett commented 7 years ago

Is there a way to publish new devices on the fly? I tried destroying the instance and reinitialize it with new devices, but it kicks out a "throw new Error('Socket is already bound');" error. Currently, the only way I can find is restarting the application entirely.

dsandor commented 7 years ago

Can you share some of your code? My guess is you are creating new instances of the FauxMo class when you add a new device.

That won't work because it will try to create a new set of SSDP services.

We could add in some code to allow the devices configuration to be appended to after initialization.

dsandor commented 7 years ago

@jaretburkett can you check and see if the code @neophob just updated fixes your issue?