mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-04-20 22:05:51 +01:00
Merge pull request #813 from lbredeso/updated-settings-state-fix
SHARD-159: Wemo (Connect) updated() fails in certain IP change scenarios
This commit is contained in:
@@ -236,8 +236,6 @@ def addSwitches() {
|
|||||||
d = getChildDevices()?.find {
|
d = getChildDevices()?.find {
|
||||||
it.deviceNetworkId == selectedSwitch.value.mac || it.device.getDataValue("mac") == selectedSwitch.value.mac
|
it.deviceNetworkId == selectedSwitch.value.mac || it.device.getDataValue("mac") == selectedSwitch.value.mac
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!d) {
|
if (!d) {
|
||||||
log.debug "Creating WeMo Switch with dni: ${selectedSwitch.value.mac}"
|
log.debug "Creating WeMo Switch with dni: ${selectedSwitch.value.mac}"
|
||||||
d = addChildDevice("smartthings", "Wemo Switch", selectedSwitch.value.mac, selectedSwitch?.value.hub, [
|
d = addChildDevice("smartthings", "Wemo Switch", selectedSwitch.value.mac, selectedSwitch?.value.hub, [
|
||||||
@@ -256,6 +254,7 @@ def addSwitches() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
def addMotions() {
|
def addMotions() {
|
||||||
def motions = getWemoMotions()
|
def motions = getWemoMotions()
|
||||||
@@ -267,8 +266,6 @@ def addMotions() {
|
|||||||
d = getChildDevices()?.find {
|
d = getChildDevices()?.find {
|
||||||
it.deviceNetworkId == selectedMotion.value.mac || it.device.getDataValue("mac") == selectedMotion.value.mac
|
it.deviceNetworkId == selectedMotion.value.mac || it.device.getDataValue("mac") == selectedMotion.value.mac
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!d) {
|
if (!d) {
|
||||||
log.debug "Creating WeMo Motion with dni: ${selectedMotion.value.mac}"
|
log.debug "Creating WeMo Motion with dni: ${selectedMotion.value.mac}"
|
||||||
d = addChildDevice("smartthings", "Wemo Motion", selectedMotion.value.mac, selectedMotion?.value.hub, [
|
d = addChildDevice("smartthings", "Wemo Motion", selectedMotion.value.mac, selectedMotion?.value.hub, [
|
||||||
@@ -287,6 +284,7 @@ def addMotions() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
def addLightSwitches() {
|
def addLightSwitches() {
|
||||||
def lightSwitches = getWemoLightSwitches()
|
def lightSwitches = getWemoLightSwitches()
|
||||||
@@ -298,8 +296,6 @@ def addLightSwitches() {
|
|||||||
d = getChildDevices()?.find {
|
d = getChildDevices()?.find {
|
||||||
it.deviceNetworkId == selectedLightSwitch.value.mac || it.device.getDataValue("mac") == selectedLightSwitch.value.mac
|
it.deviceNetworkId == selectedLightSwitch.value.mac || it.device.getDataValue("mac") == selectedLightSwitch.value.mac
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (!d) {
|
if (!d) {
|
||||||
log.debug "Creating WeMo Light Switch with dni: ${selectedLightSwitch.value.mac}"
|
log.debug "Creating WeMo Light Switch with dni: ${selectedLightSwitch.value.mac}"
|
||||||
d = addChildDevice("smartthings", "Wemo Light Switch", selectedLightSwitch.value.mac, selectedLightSwitch?.value.hub, [
|
d = addChildDevice("smartthings", "Wemo Light Switch", selectedLightSwitch.value.mac, selectedLightSwitch?.value.hub, [
|
||||||
@@ -318,6 +314,7 @@ def addLightSwitches() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
def ssdpSwitchHandler(evt) {
|
def ssdpSwitchHandler(evt) {
|
||||||
def description = evt.description
|
def description = evt.description
|
||||||
|
|||||||
Reference in New Issue
Block a user