leftyfl1p / homebridge-poolcontroller

Homebridge plugin for Pentair pools
5 stars 5 forks source link

Status update from external events #1

Closed tagyoureit closed 7 years ago

tagyoureit commented 7 years ago

Right now, the code from the refactor branch doesn't process updates from external changes. If I turn my pool off from the controller, it won't show in Home. If I open/close the home app, the change is then shown. So it seems like the change isn't pushed properly.

I've tried:

this.accessory.getService(Service.Switch).setCharacteristic(Characteristic.On, circuitState)
  |  
  | //  this.accessory.getService(Service.Switch).getCharacteristic(Characteristic.On).setValue(circuitState)
  | //    this.accessory.getService(Service.Switch).getCharacteristic(Characteristic.On).updateValue(circuitState);

The code is here: https://github.com/leftyfl1p/homebridge-poolcontroller/blob/refactor/circuitAccessory.js#L57

leftyfl1p commented 7 years ago

All three of these work for me, including the line I had before: https://github.com/leftyfl1p/homebridge-poolcontroller/blob/master/index.js#L187

Really confused. At first, the first line wasn't working, then after shuffling through the different methods a couple times I went back to it and it started working.

tagyoureit commented 7 years ago

Errr?? All 3 work. It only seems to work for me if I do a refresh. If I stare at the Home/Eve screen with the Off/On button and then change the status of the circuit somewhere else, it doesn't get pushed properly to my device. It only works properly when polling. Are you saying it works with push updates for you?

leftyfl1p commented 7 years ago

I get push updates, yea. Perhaps related to this? https://github.com/nfarina/homebridge/issues/1353

tagyoureit commented 7 years ago

Good find! I think I saw that a couple weeks ago and tried the 0/1 thing, but now it looks like there is a fix. Will try the 0.4.22 tonight. 👍

leftyfl1p commented 7 years ago

It appears that the above issue was the culprit and an update solved it.