ilcato / homebridge-Fibaro-HC2

Homebridge plugin for Fibaro Home Center 2 (and Home Center Lite ...)
Apache License 2.0
66 stars 27 forks source link

trap on Added/changed accessory #69

Closed 10der closed 7 years ago

10der commented 7 years ago

[2017-7-8 19:44:37] [FibaroHC2] Error getting data from Home Center: TypeError: Cannot read property 'getCharacteristic' of undefined at Accessory._sideloadServices (/usr/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:857:5) at PlatformAccessory._prepareAssociatedHAPAccessory (/usr/lib/node_modules/homebridge/lib/platformAccessory.js:148:32) at Server._handleRegisterPlatformAccessories (/usr/lib/node_modules/homebridge/lib/server.js:431:15) at Server. (/usr/lib/node_modules/homebridge/lib/server.js:36:10) at emitOne (events.js:115:13) at API.emit (events.js:210:7) at API.registerPlatformAccessories (/usr/lib/node_modules/homebridge/lib/api.js:159:8) at ShadowAccessory.resgisterUpdateccessory (/usr/lib/node_modules/homebridge-fibaro-hc2/dist/shadows.js:88:17) at FibaroHC2.addAccessory (/usr/lib/node_modules/homebridge-fibaro-hc2/dist/index.js:166:25) at LoadAccessories.devices.map (/usr/lib/node_modules/homebridge-fibaro-hc2/dist/index.js:113:22)

10der commented 7 years ago

addAccessory(shadowAccessory) { if (shadowAccessory == undefined) return; this.log("Trying to Added/changed accessory: ", shadowAccessory.name);

[2017-7-8 20:11:36] [FibaroHC2] Trying to Added/changed accessory: Outdoors sensors [2017-7-8 20:11:36] [FibaroHC2] Error getting data from Home Center: TypeError: Cannot read property 'getCharacteristic' of undefined

btw Outdoors sensors - VD

10der commented 7 years ago

so. I have temporarily disabled loading virtual_device(s) in LoadAccessories(devices) method if (s.type != "virtual_device")

now, all OK.

please, fix it ASAP.

thank you!

ilcato commented 7 years ago

The problem will be fixed in an upcoming release. It is related to a vd without buttons. In the mean time try to exclude such a vd by prepending an _ to its name or via a user without visibility on it.