michbeck100/pimatic-hap

Crash with "undefined" and switches

Gernot opened this issue · 5 comments

Hi, thanks for fixing #56! I think this one is similar.

10:28:27.621 [pimatic] A uncaught exception occured: TypeError: Cannot read property 'then' of undefined
10:28:27.621 [pimatic]>    at PowerSwitchAccessory.BaseAccessory.handleReturnPromise (/home/pi/pimatic-app/node_modules/pimatic-hap/accessories/base.coffee:50:9)
10:28:27.621 [pimatic]>    at PowerSwitchAccessory.handleReturnPromise (/home/pi/pimatic-app/node_modules/pimatic-hap/accessories/base.coffee:1:1)
10:28:27.621 [pimatic]>    at null.<anonymous> (/home/pi/pimatic-app/node_modules/pimatic-hap/accessories/switch.coffee:39:12)
10:28:27.621 [pimatic]>    at emitThree (events.js:97:13)
10:28:27.621 [pimatic]>    at null.emit (events.js:175:7)
10:28:27.621 [pimatic]>    at null.Characteristic.getValue (/home/pi/pimatic-app/node_modules/pimatic-hap/node_modules/hap-nodejs/lib/Characteristic.js:120:10)
10:28:27.621 [pimatic]>    at Bridge.<anonymous> (/home/pi/pimatic-app/node_modules/pimatic-hap/node_modules/hap-nodejs/lib/Accessory.js:621:20)
10:28:27.621 [pimatic]>    at Array.forEach (native)
10:28:27.621 [pimatic]>    at Bridge.Accessory._handleGetCharacteristics (/home/pi/pimatic-app/node_modules/pimatic-hap/node_modules/hap-nodejs/lib/Accessory.js:585:8)
10:28:27.621 [pimatic]>    at emitMany (events.js:108:13)
10:28:27.621 [pimatic]>    at HAPServer.emit (events.js:182:7)
10:28:27.621 [pimatic]>    at HAPServer._handleCharacteristics (/home/pi/pimatic-app/node_modules/pimatic-hap/node_modules/hap-nodejs/lib/HAPServer.js:921:10)
10:28:27.621 [pimatic]>    at HAPServer.<anonymous> (/home/pi/pimatic-app/node_modules/pimatic-hap/node_modules/hap-nodejs/lib/HAPServer.js:204:39)
10:28:27.621 [pimatic]>    at emitNone (events.js:67:13)
10:28:27.621 [pimatic]>    at IncomingMessage.emit (events.js:166:7)
10:28:27.621 [pimatic]>    at endReadableNT (_stream_readable.js:923:12)
10:28:27.621 [pimatic]>    at nextTickCallbackWith2Args (node.js:458:9)
10:28:27.621 [pimatic]>    at process._tickCallback (node.js:372:17)
10:28:27.621 [pimatic]> This is most probably a bug in pimatic or in a module, please report it!
10:28:27.629 [pimatic] shutting pimatic down...

Thanks for looking into this! :-)

Which type of switch are you using here?

WeMo Switch. I'm using Pimatic to integrate all my outdated Pre-HomeKit stuff into my setup :-)

If you are using the pimatic-wemo plugin, then this issue isn't on my side: muldy/pimatic-wemo#3

Ah, I see. Thanks. That's above my skills in CoffeeScript :-)

I'm closing this now, because of muldy/pimatic-wemo#3