Closed anthonywebb closed 7 years ago
have a look here: https://github.com/cflurin/homebridge-mqtt/blob/master/lib/accessory.js
Accessory.prototype.save_and_setValue
and here: https://github.com/KhaosT/HAP-NodeJS/blob/master/lib/Characteristic.js
* @event 'set' => function(newValue, callback(err), context) { }
* Emitted when someone calls setValue() on this Characteristic with a desired new value. If there
* are any listeners to this event, one of them MUST call the callback in order for this.value to
* actually be set. The `context` object is whatever was passed in by the initiator of this change
* (for instance, whomever called `setValue`).
I've been hunting through your code to figure out how you ended up getting around the issue where someone changes state, but not from within the homekit UI (say someone presses a button on the wall). Right now all is well with my plugin so long as everyone uses homekit to toggle the lights, once a wall button is pressed everything is out of sync. My code (for CBus) very closely models this plugin https://github.com/YahavGB/homebridge-mox