tommasomarchionni / homebridge-openHAB

Homebridge plugin for openHAB
Apache License 2.0
49 stars 18 forks source link

TypeError: this.uniqueIds[this.itemList[key].itemUniqueAggregationId][("set" + this.itemList[key].itemSubType)] is not a function #18

Open gretel opened 8 years ago

gretel commented 8 years ago

with all due respect but the code looks spaghetti and fails accordingly:

Feb 19 01:25:50 DietPi node[19060]: /opt/node/lib/node_modules/homebridge-openhab/libs/ItemFactory.js:68
Feb 19 01:25:50 DietPi node[19060]: this.uniqueIds[this.itemList[key].itemUniqueAggregationId]['set'+this.itemList[key].itemSubType](this.itemList[key]);
Feb 19 01:25:50 DietPi node[19060]: ^
Feb 19 01:25:50 DietPi node[19060]: TypeError: this.uniqueIds[this.itemList[key].itemUniqueAggregationId][("set" + this.itemList[key].itemSubType)] is not a function
Feb 19 01:25:50 DietPi node[19060]: at exports.Factory.parseSitemap (/opt/node/lib/node_modules/homebridge-openhab/libs/ItemFactory.js:68:113)
Feb 19 01:25:50 DietPi node[19060]: at Request._callback (/opt/node/lib/node_modules/homebridge-openhab/index.js:106:34)
Feb 19 01:25:50 DietPi node[19060]: at Request.self.callback (/opt/node/lib/node_modules/homebridge-openhab/node_modules/request/request.js:199:22)
Feb 19 01:25:50 DietPi node[19060]: at emitTwo (events.js:87:13)
Feb 19 01:25:50 DietPi node[19060]: at Request.emit (events.js:172:7)
Feb 19 01:25:50 DietPi node[19060]: at Request.<anonymous> (/opt/node/lib/node_modules/homebridge-openhab/node_modules/request/request.js:1036:10)
Feb 19 01:25:50 DietPi node[19060]: at emitOne (events.js:82:20)
Feb 19 01:25:50 DietPi node[19060]: at Request.emit (events.js:169:7)
Feb 19 01:25:50 DietPi node[19060]: at IncomingMessage.<anonymous> (/opt/node/lib/node_modules/homebridge-openhab/node_modules/request/request.js:963:12)
Feb 19 01:25:50 DietPi node[19060]: at emitNone (events.js:72:20)
redhell commented 8 years ago

Duplicate ID?