nitaybz / homebridge-tado-ac

Homebridge plugin to support Tado Smart AC Control devices.
MIT License
40 stars 12 forks source link

Array in disableAcAccessory won't work #98

Closed kczernuszewicz closed 4 years ago

kczernuszewicz commented 4 years ago

If selecting an array in disableAcAccessory, it will either show all accessories or show none at all.

(node:4838) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'includes' of undefined
    at new AirConditioner (/usr/local/lib/node_modules/homebridge-tado-ac/homekit/AirConditioner.js:37:180)
    at /usr/local/lib/node_modules/homebridge-tado-ac/tado/syncHomeKitCache.js:15:28
    at Array.forEach (<anonymous>)
    at TadoACPlatform.syncHomeKitCache (/usr/local/lib/node_modules/homebridge-tado-ac/tado/syncHomeKitCache.js:7:20)
    at HomebridgeAPI.<anonymous> (/usr/local/lib/node_modules/homebridge-tado-ac/index.js:152:9)
(node:4838) 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: 1)
(node:4838) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:4838) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'includes' of undefined
    at new AirConditioner (/usr/local/lib/node_modules/homebridge-tado-ac/homekit/AirConditioner.js:37:180)
    at /usr/local/lib/node_modules/homebridge-tado-ac/tado/syncHomeKitCache.js:15:28
    at Array.forEach (<anonymous>)
    at TadoACPlatform.syncHomeKitCache (/usr/local/lib/node_modules/homebridge-tado-ac/tado/syncHomeKitCache.js:7:20)
    at Timeout._onTimeout (/usr/local/lib/node_modules/homebridge-tado-ac/tado/refreshState.js:41:15)
(node:4838) 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: 2)
nitaybz commented 4 years ago

will fix asap

nitaybz commented 4 years ago

show me your config please, I think the mistake is there...

nitaybz commented 4 years ago

nevermind, found it!

nitaybz commented 4 years ago

please check the latest release

kczernuszewicz commented 4 years ago

Working purrrrfect! Thanks a lot!

Although now it leaves an empty accessory in Home without the possibility to remove it from the favourites with the accessory that's been disabled.

image

nitaybz commented 4 years ago

I tried something to see if it deletes your empty accessory... please try version 4.0.5

kczernuszewicz commented 4 years ago

It did the trick, tho the log is being spammed with

[10/18/2020, 9:17:47 PM] [TadoAC] Creating New TadoAC AirConditioner Accessory in the Living Room AC
[10/18/2020, 9:17:59 PM] [TadoAC] Creating New TadoAC AirConditioner Accessory in the Living Room AC
[10/18/2020, 9:18:10 PM] [TadoAC] Creating New TadoAC AirConditioner Accessory in the Living Room AC
[10/18/2020, 9:18:22 PM] [TadoAC] Creating New TadoAC AirConditioner Accessory in the Living Room AC
[10/18/2020, 9:18:33 PM] [TadoAC] Creating New TadoAC AirConditioner Accessory in the Living Room AC

not sure it matters.

nitaybz commented 4 years ago

it was creating the empty accessory and deleting it every time... version 4.0.6 should prevent this from happening... please confirm

kczernuszewicz commented 4 years ago

Working perfectly fine.

This kind of log appeared upon start of the homebridge, not sure if it's anything relevant, just letting you know.

(node:14757) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'getService' of undefined
    at AirConditioner.removeThermostatService (/usr/local/lib/node_modules/homebridge-tado-ac/homekit/AirConditioner.js:318:42)
    at new AirConditioner (/usr/local/lib/node_modules/homebridge-tado-ac/homekit/AirConditioner.js:101:9)
    at /usr/local/lib/node_modules/homebridge-tado-ac/tado/syncHomeKitCache.js:15:28
    at Array.forEach (<anonymous>)
    at TadoACPlatform.syncHomeKitCache (/usr/local/lib/node_modules/homebridge-tado-ac/tado/syncHomeKitCache.js:7:20)
    at HomebridgeAPI.<anonymous> (/usr/local/lib/node_modules/homebridge-tado-ac/index.js:152:9)
(node:14757) 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: 1)
(node:14757) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:14757) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'getService' of undefined
    at AirConditioner.removeThermostatService (/usr/local/lib/node_modules/homebridge-tado-ac/homekit/AirConditioner.js:318:42)
    at new AirConditioner (/usr/local/lib/node_modules/homebridge-tado-ac/homekit/AirConditioner.js:101:9)
    at /usr/local/lib/node_modules/homebridge-tado-ac/tado/syncHomeKitCache.js:15:28
    at Array.forEach (<anonymous>)
    at TadoACPlatform.syncHomeKitCache (/usr/local/lib/node_modules/homebridge-tado-ac/tado/syncHomeKitCache.js:7:20)
    at Timeout._onTimeout (/usr/local/lib/node_modules/homebridge-tado-ac/tado/refreshState.js:41:15)
(node:14757) 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: 2)
nitaybz commented 4 years ago

🤦‍♂️ version 4.0.7 please

kczernuszewicz commented 4 years ago

This part is still there

(node:15283) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'update' of undefined
    at /usr/local/lib/node_modules/homebridge-tado-ac/tado/refreshState.js:34:29
    at Array.forEach (<anonymous>)
    at Timeout._onTimeout (/usr/local/lib/node_modules/homebridge-tado-ac/tado/refreshState.js:29:23)
(node:15283) 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: 1)
(node:15283) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
nitaybz commented 4 years ago

sorry for letting you do all the testings it's just that it's hard for me at the moment to replicate the behaviour locally. please try version 4.0.8

kczernuszewicz commented 4 years ago

No problem ;) It works perfect fine, no phantom accessories, no vague messages in logs! :D

nitaybz commented 4 years ago

great! glad to hear.... closing the issue :)