SHARD-159: Wemo (Connect) updated() fails in certain IP change scenarios

This commit is contained in:
Luke Bredeson
2016-04-20 16:07:11 -05:00
parent 8b465b03b4
commit 84de336a1a

View File

@@ -236,8 +236,6 @@ def addSwitches() {
d = getChildDevices()?.find {
it.deviceNetworkId == selectedSwitch.value.mac || it.device.getDataValue("mac") == selectedSwitch.value.mac
}
}
if (!d) {
log.debug "Creating WeMo Switch with dni: ${selectedSwitch.value.mac}"
d = addChildDevice("smartthings", "Wemo Switch", selectedSwitch.value.mac, selectedSwitch?.value.hub, [
@@ -256,6 +254,7 @@ def addSwitches() {
}
}
}
}
def addMotions() {
def motions = getWemoMotions()
@@ -267,8 +266,6 @@ def addMotions() {
d = getChildDevices()?.find {
it.deviceNetworkId == selectedMotion.value.mac || it.device.getDataValue("mac") == selectedMotion.value.mac
}
}
if (!d) {
log.debug "Creating WeMo Motion with dni: ${selectedMotion.value.mac}"
d = addChildDevice("smartthings", "Wemo Motion", selectedMotion.value.mac, selectedMotion?.value.hub, [
@@ -287,6 +284,7 @@ def addMotions() {
}
}
}
}
def addLightSwitches() {
def lightSwitches = getWemoLightSwitches()
@@ -298,8 +296,6 @@ def addLightSwitches() {
d = getChildDevices()?.find {
it.deviceNetworkId == selectedLightSwitch.value.mac || it.device.getDataValue("mac") == selectedLightSwitch.value.mac
}
}
if (!d) {
log.debug "Creating WeMo Light Switch with dni: ${selectedLightSwitch.value.mac}"
d = addChildDevice("smartthings", "Wemo Light Switch", selectedLightSwitch.value.mac, selectedLightSwitch?.value.hub, [
@@ -318,6 +314,7 @@ def addLightSwitches() {
}
}
}
}
def ssdpSwitchHandler(evt) {
def description = evt.description