derekprior / homebridge-schluter-thermostat

A homebridge plugin to control Schluter thermostats
MIT License
9 stars 2 forks source link

Unhandled Error - TempUnitIsCelsius not defined #13

Closed ryanfroese closed 1 month ago

ryanfroese commented 1 year ago

The TempUnitIsCelsius (seems to be a bool variable) is not defined, and throws an unhandled error. Here are the logs from my Homebridge in debug mode:

[3/13/2023, 8:30:21 AM] [Master Bed Thermostat] GET CurrentHeatingCoolingState [3/13/2023, 8:30:21 AM] [Master Bed Thermostat] GET TargetHeatingCoolingState [3/13/2023, 8:30:21 AM] [Master Bed Thermostat] GET CurrentTemperature [3/13/2023, 8:30:21 AM] [Master Bed Thermostat] GET TargetTemperature [3/13/2023, 8:30:21 AM] [Master Bed Thermostat] GET TemperatureDisplayUnits [3/13/2023, 8:30:21 AM] [Master Bed Thermostat] Appending session ID lxb2nsvAjE6TgbSCkGE83w to request [3/13/2023, 8:30:21 AM] [Master Bed Thermostat] 401 Unauthorized, clearing session ID [3/13/2023, 8:30:21 AM] [homebridge-schluter-thermostat] This plugin threw an error from the characteristic 'Temperature Display Units': Unhandled error thrown inside read handler for characteristic: Cannot read properties of undefined (reading 'TempUnitIsCelsius'). See https://homebridge.io/w/JtMGR for more info. [3/13/2023, 8:30:21 AM] [homebridge-schluter-thermostat] TypeError: Cannot read properties of undefined (reading 'TempUnitIsCelsius') at SchluterAPI.getTemperatureUnit (/volume1/homebridge/node_modules/homebridge-schluter-thermostat/src/schluter-api.ts:81:21) at runMicrotasks () at processTicksAndRejections (node:internal/process/task_queues:96:5) [3/13/2023, 8:30:21 AM] [Master Bed Thermostat] Appending session ID zjz_Thneq0yVFNhKQSPxlA to request [3/13/2023, 8:30:21 AM] [Master Bed Thermostat] Appending session ID 9AKlV-GhAkGNlxpLYgPB-w to request

Let me know if you need any further help, or if this is just a "me" problem!

adisor19 commented 8 months ago

Seeing the same error in my logs :

[homebridge-schluter-thermostat] This plugin threw an error from the characteristic 'Temperature Display Units': Unhandled error thrown inside read handler for characteristic: Cannot read properties of undefined (reading 'TempUnitIsCelsius'). See https://homebridge.io/w/JtMGR for more info.

So you're not the only one.. that being said I'm not sure if the plugin is still being maintained :/

winterborn commented 1 month ago

Hey, I believe this unhandled error should be properly handled here.

I will raise a PR for this once my previous PR has been accepted / merged in.

derekprior commented 1 month ago

Should be fixed in https://github.com/winterborn/homebridge-schluter-thermostat/commit/060c88658932b1e01a4d7471640d569ec80cfb1a, thanks to @winterborn

winterborn commented 1 month ago

Nice, I noticed you pulled in my changes @derekprior , do you not need me to PR after all?