philip1986 / pimatic-led-light

A template for creating plugins
http://pimatic.org/
GNU General Public License v2.0
7 stars 13 forks source link

Error with Yeelights #74

Open kiwikern opened 6 years ago

kiwikern commented 6 years ago

I've added a couple of different Yeelight devices (color bulb, white bulb, desk lamp). With all of them, I experience the same behavior: Triggering an action results in at least five 'DONE' toast messages, but turning the lamps on/off works. When changing either color or brightness, the controls wildly change (turning on/off several times etc.) until this error message appears:

error [pimatic]: An uncaught exception occurred: TypeError: Cannot read property 'location' of undefined
    at Yeelight._matchDevice (/home/pi/pimatic-app/node_modules/pimatic-led-light/devices/yeelight.coffee:124:8)
    at Yeelight._this.disconnectHandler (/home/pi/pimatic-app/node_modules/pimatic-led-light/devices/yeelight.coffee:55:15)
    at emitOne (events.js:82:20)
    at Yeelight.emit (events.js:169:7)
    at Yeelight.<anonymous> (/home/pi/pimatic-app/node_modules/pimatic-led-light/node_modules/node-yeelight/index.js:73:9)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at Socket.emit (/home/pi/pimatic-app/node_modules/pimatic/startup.coffee:63:24)
    at TCP._onclose (net.js:486:12)
 This is most probably a bug in pimatic or in a module, please report it!
kiwikern commented 6 years ago

Switching to the v0.9.x branch using these instructions and creating the devices (for the yeelights) manually via the config resolved the issue. (sorry!)

kiwikern commented 6 years ago

Unfortunately, the error still occurs after the update.

error [pimatic]: An uncaught exception occurred: TypeError: Cannot read property 'location' of undefined
    at Yeelight._matchDevice (/home/pi/pimatic-app/node_modules/pimatic-led-light/devices/yeelight.coffee:124:8)
    at Yeelight._this.disconnectHandler (/home/pi/pimatic-app/node_modules/pimatic-led-light/devices/yeelight.coffee:55:15)
    at emitOne (events.js:82:20)
    at Yeelight.emit (events.js:169:7)
    at Yeelight.<anonymous> (/home/pi/pimatic-app/node_modules/node-yeelight/index.js:73:9)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at Socket.emit (/home/pi/pimatic-app/node_modules/pimatic/startup.coffee:63:24)
    at TCP._onclose (net.js:477:12)
 This is most probably a bug in pimatic or in a module, please report it!