Hexagon / node-telldus

Node bindings for telldus-core
Other
34 stars 10 forks source link

No really an issue, but a question of best practice #72

Closed jdagerot closed 7 years ago

jdagerot commented 8 years ago

I use telldus.addDeviceEventListener

to listen on my switches. When for example switch 10 gets triggered I want to turn on three devices. However, for every device I turn on the addDeviceListener is triggered again. Why is this happening, is the device sending it's status to tellstick when the status has changed, or is tellstick triggering itself?

Arkkimaagi commented 7 years ago

What I understand, yes, Tellstick is triggering itself.

plastbox commented 7 years ago

To be fair, changing the state of a device is a "device event", regardless of it's source. Imagine an application where several distinct modules all track device state by use of addDeviceEventListener.