Skip to content

Commit

Permalink
Merge pull request SmartThingsCommunity#38309 from SmartThingsCommuni…
Browse files Browse the repository at this point in the history
…ty/production

Rolling down production commits to acceptance
  • Loading branch information
greens authored Jul 23, 2020
2 parents 1dfc264 + 0b40a1a commit 2fe1463
Showing 1 changed file with 9 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,9 @@ def updated() {
log.debug "updated()"
updateDataValue("onOff", "catchall")
for (child in childDevices) {
if (!child.deviceNetworkId.startsWith(device.deviceNetworkId)) { //parent DNI has changed after rejoin
child.setDeviceNetworkId("${device.deviceNetworkId}:${getChildEndpoint(child.deviceNetworkId)}")
if (!child.deviceNetworkId.startsWith(device.deviceNetworkId) || //parent DNI has changed after rejoin
!child.deviceNetworkId.split(':')[-1].startsWith('0')) {
child.setDeviceNetworkId("${device.deviceNetworkId}:0${getChildEndpoint(child.deviceNetworkId)}")
}
}
refresh()
Expand Down Expand Up @@ -131,10 +132,12 @@ def parse(String description) {
}

private void createChildDevices() {
def x = getChildCount()
for (i in 2..x) {
addChildDevice("Child Switch Health", "${device.deviceNetworkId}:${i}", device.hubId,
[completedSetup: true, label: "${device.displayName[0..-2]}${i}", isComponent: false])
if (!childDevices) {
def x = getChildCount()
for (i in 2..x) {
addChildDevice("Child Switch Health", "${device.deviceNetworkId}:0${i}", device.hubId,
[completedSetup: true, label: "${device.displayName[0..-2]}${i}", isComponent: false])
}
}
}

Expand Down

0 comments on commit 2fe1463

Please sign in to comment.