michbeck100 / pimatic-hap

Pimatic homekit bridge
GNU General Public License v2.0
30 stars 10 forks source link

Error when pressing TradfriPlug switch in homekit on iPhone #78

Closed sverrevh closed 4 years ago

sverrevh commented 5 years ago

I'm getting the following error when pressing a switch in homekit on my iPhone:

error [pimatic]: An uncaught exception occurred: TypeError: promise.then(...).catch(...).done is not a function at PowerSwitchAccessory.BaseAccessory.handleVoidPromise (/home/pi/pimatic-app/node_modules/pimatic-hap/accessories/base.coffee:61:10) at PowerSwitchAccessory.handleVoidPromise (/home/pi/pimatic-app/node_modules/pimatic-hap/accessories/base.coffee:1:1) at null. (/home/pi/pimatic-app/node_modules/pimatic-hap/accessories/switch.coffee:35:12) at emitMany (events.js:108:13) at null.emit (events.js:182:7) at null.Characteristic.setValue (/home/pi/pimatic-app/node_modules/pimatic-hap/node_modules/hap-nodejs/lib/Characteristic.js:292:10) at Bridge. (/home/pi/pimatic-app/node_modules/pimatic-hap/node_modules/hap-nodejs/lib/Accessory.js:812:22) at Array.forEach (native) at Bridge.Accessory._handleSetCharacteristics (/home/pi/pimatic-app/node_modules/pimatic-hap/node_modules/hap-nodejs/lib/Accessory.js:757:8) at emitMany (events.js:108:13) at HAPServer.emit (events.js:182:7) at HAPServer._handleCharacteristics (/home/pi/pimatic-app/node_modules/pimatic-hap/node_modules/hap-nodejs/lib/HAPServer.js:972:10) at HAPServer. (/home/pi/pimatic-app/node_modules/pimatic-hap/node_modules/hap-nodejs/lib/HAPServer.js:209:39) at emitNone (events.js:67:13) at IncomingMessage.emit (events.js:166:7) at endReadableNT (_stream_readable.js:913:12) at nextTickCallbackWith2Args (node.js:442:9) at process._tickCallback (node.js:356:17) This is most probably a bug in pimatic or in a module, please report it!

This is the new TradfriPlug device from the pimatic-tradfri plugin. The device is recognised by pimatic-hap and added as a switch. However the above error occurs when pressing the switch in homekit. Pimatic is not crashing, and everything seems to be working. Only this strange error.

Any idea on how to fix?

See also: https://github.com/treban/pimatic-tradfri/blob/master/tradfri.coffee#L629 https://github.com/michbeck100/pimatic-hap/blob/master/accessories/base.coffee#L61 https://github.com/michbeck100/pimatic-hap/blob/master/accessories/switch.coffee#L35

michbeck100 commented 5 years ago

Has to be fixed in the tradfri plugin

treban commented 5 years ago

I think this problem is related to #81. The promise block of the function has no done() block.

michbeck100 commented 5 years ago

Did you check the latest release? I think the error should be gone.

michbeck100 commented 5 years ago

Is the problem solved?

michbeck100 commented 4 years ago

@sverrevh Is this issue solved with the latest release of pimatic-hap?

sverrevh commented 4 years ago

Don't know, only using Homekit for Tradfri via Tradfri bridge now.

michbeck100 commented 4 years ago

Ok, so I close this issue for now.