From 0423fb23566cc6a8453208cca41698d44b08efe4 Mon Sep 17 00:00:00 2001 From: MGoralczykS Date: Tue, 11 Aug 2020 13:15:06 +0200 Subject: [PATCH 1/4] Delete child switches on Flush Relay 1/1D --- .../qubino-flush-2-relay.src/qubino-flush-2-relay.groovy | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/devicetypes/qubino/qubino-flush-2-relay.src/qubino-flush-2-relay.groovy b/devicetypes/qubino/qubino-flush-2-relay.src/qubino-flush-2-relay.groovy index 9a1d7e87193..20602df5535 100644 --- a/devicetypes/qubino/qubino-flush-2-relay.src/qubino-flush-2-relay.groovy +++ b/devicetypes/qubino/qubino-flush-2-relay.src/qubino-flush-2-relay.groovy @@ -74,11 +74,12 @@ metadata { def installed() { if (zwaveInfo?.model.equals("0051")) { state.numberOfSwitches = 2 - } else { + + } else if (zwaveInfo?.model.equals("0052") && zwaveInfo?.model.equals("0053")){ state.numberOfSwitches = 1 } - if (!childDevices) { + if (!childDevices && state.numberOfSwitches > 1) { addChildSwitches(state.numberOfSwitches) } sendEvent(name: "checkInterval", value: 2 * 15 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID]) @@ -93,12 +94,12 @@ def installed() { } // Preferences template end response([ - refresh((1..state.numberOfSwitches).toList()) + refresh((1..state.numberOfSwitches).toList()) ]) } def updated() { - if (!childDevices) { + if (!childDevices && state.numberOfSwitches > 1) { addChildSwitches(state.numberOfSwitches) } // Preferences template begin From 9744b74e0f9a2d37d782005df32a53ff80cca891 Mon Sep 17 00:00:00 2001 From: MGoralczykS Date: Wed, 12 Aug 2020 08:56:39 +0200 Subject: [PATCH 2/4] Space fix --- .../qubino/qubino-flush-2-relay.src/qubino-flush-2-relay.groovy | 1 - 1 file changed, 1 deletion(-) diff --git a/devicetypes/qubino/qubino-flush-2-relay.src/qubino-flush-2-relay.groovy b/devicetypes/qubino/qubino-flush-2-relay.src/qubino-flush-2-relay.groovy index 20602df5535..074d18b2535 100644 --- a/devicetypes/qubino/qubino-flush-2-relay.src/qubino-flush-2-relay.groovy +++ b/devicetypes/qubino/qubino-flush-2-relay.src/qubino-flush-2-relay.groovy @@ -74,7 +74,6 @@ metadata { def installed() { if (zwaveInfo?.model.equals("0051")) { state.numberOfSwitches = 2 - } else if (zwaveInfo?.model.equals("0052") && zwaveInfo?.model.equals("0053")){ state.numberOfSwitches = 1 } From 47b3612233728b682e833f68a04e23530289238a Mon Sep 17 00:00:00 2001 From: MGoralczykS Date: Wed, 12 Aug 2020 14:23:27 +0200 Subject: [PATCH 3/4] Fixes --- .../qubino/qubino-flush-2-relay.src/qubino-flush-2-relay.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devicetypes/qubino/qubino-flush-2-relay.src/qubino-flush-2-relay.groovy b/devicetypes/qubino/qubino-flush-2-relay.src/qubino-flush-2-relay.groovy index 074d18b2535..72936386887 100644 --- a/devicetypes/qubino/qubino-flush-2-relay.src/qubino-flush-2-relay.groovy +++ b/devicetypes/qubino/qubino-flush-2-relay.src/qubino-flush-2-relay.groovy @@ -74,7 +74,7 @@ metadata { def installed() { if (zwaveInfo?.model.equals("0051")) { state.numberOfSwitches = 2 - } else if (zwaveInfo?.model.equals("0052") && zwaveInfo?.model.equals("0053")){ + } else if (zwaveInfo?.model.equals("0052") || zwaveInfo?.model.equals("0053")) { state.numberOfSwitches = 1 } From 6f74331a005c6ab7a3ed6d36760cfd3577e760b3 Mon Sep 17 00:00:00 2001 From: MGoralczykS Date: Wed, 19 Aug 2020 12:56:29 +0200 Subject: [PATCH 4/4] Fixes --- .../qubino/qubino-flush-2-relay.src/qubino-flush-2-relay.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/devicetypes/qubino/qubino-flush-2-relay.src/qubino-flush-2-relay.groovy b/devicetypes/qubino/qubino-flush-2-relay.src/qubino-flush-2-relay.groovy index 72936386887..b6b799ee961 100644 --- a/devicetypes/qubino/qubino-flush-2-relay.src/qubino-flush-2-relay.groovy +++ b/devicetypes/qubino/qubino-flush-2-relay.src/qubino-flush-2-relay.groovy @@ -74,7 +74,7 @@ metadata { def installed() { if (zwaveInfo?.model.equals("0051")) { state.numberOfSwitches = 2 - } else if (zwaveInfo?.model.equals("0052") || zwaveInfo?.model.equals("0053")) { + } else { state.numberOfSwitches = 1 }