dale3h / hue-mqtt-bridge

MQTT bridge for Philips Hue Dimmer and Hue Tap
MIT License
51 stars 6 forks source link

Publish only if sensor.state changed (fixes #12) different approach #17

Closed HomeAutoFun closed 6 years ago

HomeAutoFun commented 6 years ago

fixes this issue "Button events repeating in mqtt stream, button not pressed! #12. "

by changing this line if (undefined !== sensorB && !equal(sensorA, sensorB)) { if (undefined !== sensorB && !equal(sensorA.state, sensorB.state)) {

has the same effect as the changes that ristomatti made but with less code

dale3h commented 6 years ago

Looks good! 🎃Thank you for your contribution!

ristomatti commented 6 years ago

Apparently no thanks for contribution even with me actually taking some hours of time to figure out the root cause. If the suggested code was too terse you can always request for changes and the other guy can make it shorter. Nevertheless, good that it's fixed.