Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,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 @@ -123,10 +124,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