NorthernMan54 / homebridge-tcc

Honeywell Total Connect Comfort support for Homebridge
62 stars 23 forks source link

Add retries for update thermostat calls #113

Closed NorthernMan54 closed 2 years ago

NorthernMan54 commented 2 years ago

Tks to @atlcoder for this work and PR #110

I've been using this plugin with homebridge, and it seems to work most of the time. Once in a while, when the thermostat is updated, I get errors like this in the logs:

Sun, 30 Jan 2022 21:36:50 GMT tcc-lib ERROR: _UpdateThermostat InvalidSessionID <?xml version="1.0" encoding="utf-8"?>REDACTEDREDACTED111601741721721212</soap:Body></soap:Envelope> ChangeThermostat Error: Error: ERROR: _UpdateThermostat %s at /opt/homebrew/lib/node_modules/homebridge-tcc/lib/tcc.js:134:20 at runMicrotasks () at processTicksAndRejections (node:internal/process/task_queues:96:5) It looks like when this happens, the session ID is then cleared, and if the session ID is empty, a new login will be performed on the next api call. So, since the code should already self-heal, I'm attempting to add retries.

Potential resolution for https://github.com/NorthernMan54/homebridge-tcc/issues/109