From fbb248dc317d53dcfb688f36970de12c9d1b9cb5 Mon Sep 17 00:00:00 2001 From: Luke Bredeson Date: Thu, 10 Mar 2016 13:58:44 -0600 Subject: [PATCH] EX-45: Wemo (Connect) device addition fails on update for old devices that lack MAC in device data --- smartapps/smartthings/wemo-connect.src/wemo-connect.groovy | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/smartapps/smartthings/wemo-connect.src/wemo-connect.groovy b/smartapps/smartthings/wemo-connect.src/wemo-connect.groovy index 6213f7b..af89807 100644 --- a/smartapps/smartthings/wemo-connect.src/wemo-connect.groovy +++ b/smartapps/smartthings/wemo-connect.src/wemo-connect.groovy @@ -234,7 +234,7 @@ def addSwitches() { def d if (selectedSwitch) { d = getChildDevices()?.find { - it.dni == selectedSwitch.value.mac || it.device.getDataValue("mac") == selectedSwitch.value.mac + it.deviceNetworkId == selectedSwitch.value.mac || it.device.getDataValue("mac") == selectedSwitch.value.mac } } @@ -265,7 +265,7 @@ def addMotions() { def d if (selectedMotion) { d = getChildDevices()?.find { - it.dni == selectedMotion.value.mac || it.device.getDataValue("mac") == selectedMotion.value.mac + it.deviceNetworkId == selectedMotion.value.mac || it.device.getDataValue("mac") == selectedMotion.value.mac } } @@ -296,7 +296,7 @@ def addLightSwitches() { def d if (selectedLightSwitch) { d = getChildDevices()?.find { - it.dni == selectedLightSwitch.value.mac || it.device.getDataValue("mac") == selectedLightSwitch.value.mac + it.deviceNetworkId == selectedLightSwitch.value.mac || it.device.getDataValue("mac") == selectedLightSwitch.value.mac } }