From ad633ebed56e4675913cb0c610164d417627960f Mon Sep 17 00:00:00 2001 From: hobbyquaker Date: Thu, 2 Jan 2020 14:37:40 +0100 Subject: [PATCH] HmIPW SingleAccessory option not working (fix #240) --- homematic-devices/hmipw-dri16.js | 6 +----- homematic-devices/hmipw-drs4.js | 20 +------------------- 2 files changed, 2 insertions(+), 24 deletions(-) diff --git a/homematic-devices/hmipw-dri16.js b/homematic-devices/hmipw-dri16.js index dca97a7..d1d0326 100644 --- a/homematic-devices/hmipw-dri16.js +++ b/homematic-devices/hmipw-dri16.js @@ -72,16 +72,12 @@ class AccMultiService extends Accessory { } module.exports = class GenericContactSensor { - option(id) { - return !(this.config.options[id] && this.config.options[id].disabled); - } - constructor(config, node) { const {ccu} = node; this.ccu = ccu; this.config = config; const channels = config.description.CHILDREN; - if (this.option(config.description.ADDRESS + ':SingleAccessory')) { + if (this.option('SingleAccessory')) { new AccMultiService(config, node); } else { for (let i = 1; i < (channels.length - 1); i++) { diff --git a/homematic-devices/hmipw-drs4.js b/homematic-devices/hmipw-drs4.js index ed73960..0b2be68 100644 --- a/homematic-devices/hmipw-drs4.js +++ b/homematic-devices/hmipw-drs4.js @@ -75,30 +75,12 @@ class AccMultiService extends Accessory { } module.exports = class HmipwDrs { - option(id, option) { - let addr = this.config.description.ADDRESS; - if (!addr.includes(':')) { - addr = addr + ':' + id; - } - - let res; - - if (option) { - res = this.config.options[addr] && this.config.options[addr][option]; - } else { - res = !(this.config.options[addr] && this.config.options[addr].disabled); - } - - this.node.debug('option ' + addr + ' ' + id + ' ' + option + ' ' + res); - return res; - } - constructor(config, node) { const {ccu} = node; this.node = node; this.ccu = ccu; this.config = config; - if (this.option(config.description.ADDRESS + ':SingleAccessory')) { + if (this.option('SingleAccessory')) { new AccMultiService(config, node); } else { const channels = config.description.CHILDREN;