HommiePeter / homebridge-toon-platform

Homebridge Platform to disclose Toon Thermostat and its connected devices (Smoke Detectors, Wallplugs, Huelights) to homekit
GNU General Public License v3.0
5 stars 4 forks source link

Getting UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'currentDisplayTemp' of undefined #7

Closed MrSnoebel closed 2 years ago

MrSnoebel commented 2 years ago

This is the error in detail:

(node:6607) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'currentDisplayTemp' of undefined at new ToonThermostat (/homebridge/node_modules/homebridge-toon-platform/src/ToonThermostat.ts:68:30) at new ToonAccessory (/homebridge/node_modules/homebridge-toon-platform/src/ToonAccessorry.ts:33:9) at ToonHomebridgePlatform.discoverDevices (/homebridge/node_modules/homebridge-toon-platform/src/ToonPlatform.ts:141:9) at Timeout._onTimeout (/homebridge/node_modules/homebridge-toon-platform/src/ToonPlatform.ts:87:36) at listOnTimeout (internal/timers.js:557:17) at processTimers (internal/timers.js:500:7) (node:6607) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 230)

Giving me this message many times a second.. running the plugin for 20 seconds gives 500+ rejection ID's.

After the previous bug, I upgraded to the .96 version this one was solved just fine for a couple of days.. Not sure, but I think the upgrade to 1.3.9 broke the plugin.

Running in a docker Node.js v14.17.1 NPM v6.14.13 Plugin homebridge-toon-platform v0.9.6 Homebridge 1.3.9

MrSnoebel commented 2 years ago

Tried after upgrade homebridge to 1.4.0, problems remains. If I need to share any config, logs or anything else let me know.

HommiePeter commented 2 years ago

Dear MrSnoebel,

could you also provide me with a part of the logging when you restart the plugin. Just to make sure it logs in correctly. Other point of attention could be that you're refresh rate is set to low (<300.000 msec) resulting in a throttling action of quby side (to many requests) where to plugin works fine but (because of the throttling) quby does not provide any return data in the API-calls.

MrSnoebel commented 2 years ago

Now I feel stupid.. I set the interval at 300.. I did miss it was ms.. thought sec's.. Removed the setting in the config. All working fine now.

Thx !!

HommiePeter commented 2 years ago

Dear MrSnoebel,

Good see that de plugin works fine now. Hope it full fills your needs. Since the issue seems fixed I will close the issue. If issues reappear please log a new issue.

Kind regards

Peter