luc-ass / homebridge-evohome

Homebridge plugin for Honeywell Evohome
29 stars 16 forks source link

Status Updates via periodicUpdate #11

Closed NorthernMan54 closed 6 years ago

NorthernMan54 commented 7 years ago

I cloned your work to create an implementation for the Total Comfort Connect WebSite called homebridge-tcc and found a couple of issues with your periodicUpdate function.

1 - To update the status in home kit directly, you need to use this

              service.getCharacteristic(Characteristic.CurrentTemperature)
                          .getValue();

And not setValue. This triggers the 'get' function

  1. Moved this

myAccessories[i].device = device;

before any of the update checking, as that object is used for the status update.

luc-ass commented 7 years ago

Thanks for reporting! Did you implement it in your branch and want do commit/merge?

NorthernMan54 commented 7 years ago

Sorry I won't be able to merge the changes back, as I did major work to support the TCC Portal. To get the thermostat polling working correctly, I had made those changes. In principle what I changed was rather than having an if statement for each characteristic, had it update all characteristics by calling the getValue function for each. I had started down the path of adding an if for all the new characteristics, but after awhile found it easier just to call them all that way instead.

I also added a section to do this as part of device setup, so that on a restart it has the current values rather than the default ones.

Does the periodic update work successfully for you?