yujinakayama / homebridge-switchbot

Homebridge plugin for SwitchBot
29 stars 4 forks source link

Stateful error: "Cannot read property 'trigger' of undefined" #11

Open MarkLyck opened 3 years ago

MarkLyck commented 3 years ago

When I set the configuration to stateful the switchbot no longer works.

If I set stateful to false. It works most of the time.

I get the following error when stateful is true:

11/13/2020, 8:28:48 AM [AC] Failed turning on TypeError: Cannot read property 'trigger' of undefined
    at turnOn (/home/hoobs/.hoobs/node_modules/homebridge-switchbot-button-presser/dist/SwitchBot.js:20:21)
    at SwitchBotButtonPresser.setStatus (/home/hoobs/.hoobs/node_modules/homebridge-switchbot-button-presser/dist/accessory.js:48:23)
    at On.emit (events.js:314:20)
    at On.EventEmitter.emit (/usr/local/lib/node_modules/@hoobs/hoobs/node_modules/hap-nodejs/dist/lib/EventEmitter.js:60:38)
    at On.Characteristic._this.setValue (/usr/local/lib/node_modules/@hoobs/hoobs/node_modules/hap-nodejs/dist/lib/Characteristic.js:369:23)
    at /usr/local/lib/node_modules/@hoobs/hoobs/node_modules/hap-nodejs/dist/lib/Accessory.js:953:36
    at Array.forEach (<anonymous>)
    at Bridge.Accessory._this._handleSetCharacteristics (/usr/local/lib/node_modules/@hoobs/hoobs/node_modules/hap-nodejs/dist/lib/Accessory.js:821:18)
    at HAPServer.emit (events.js:314:20)
    at HAPServer.EventEmitter.emit (/usr/local/lib/node_modules/@hoobs/hoobs/node_modules/hap-nodejs/dist/lib/EventEmitter.js:60:38)
    at HAPServer._this._handleCharacteristics (/usr/local/lib/node_modules/@hoobs/hoobs/node_modules/hap-nodejs/dist/lib/HAPServer.js:731:23)
    at IncomingMessage.<anonymous> (/usr/local/lib/node_modules/@hoobs/hoobs/node_modules/hap-nodejs/dist/lib/HAPServer.js:240:39)
    at IncomingMessage.emit (events.js:314:20)
    at endReadableNT (_stream_readable.js:1223:12)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)