Skip to content
Merged
Show file tree
Hide file tree
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 @@ -254,8 +254,14 @@ private channelNumber(String dni) {
private void createChildDevices() {
state.oldLabel = device.label
for (i in 1..2) {
addChildDevice("Switch Child Device", "${device.deviceNetworkId}-ep${i}", null, [completedSetup: true, label: "${device.displayName} (CH${i})",
isComponent: true, componentName: "ep$i", componentLabel: "Channel $i"
addChildDevice("Switch Child Device",
"${device.deviceNetworkId}-ep${i}",
device.hubId,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the main change. The rest is just formatting. Same in the other files

[completedSetup: true,
label: "${device.displayName} (CH${i})",
isComponent: true,
componentName: "ep$i",
componentLabel: "Channel $i"
])
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,10 @@ private createChildDevices() {
addChildDevice(
"Fibaro Double Switch 2 - USB",
"${device.deviceNetworkId}-2",
null,
[completedSetup: true, label: "${device.displayName} (CH2)", isComponent: false]
device.hubId,
[completedSetup: true,
label: "${device.displayName} (CH2)",
isComponent: false]
)
} catch (Exception e) {
logging("${device.displayName} - error attempting to create child device: "+e, "debug")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,8 +241,10 @@ private createChildDevices() {
addChildDevice(
"Fibaro Wall Plug USB",
"${device.deviceNetworkId}-2",
null,
[completedSetup: true, label: "${device.displayName} (CH2)", isComponent: false]
device.hubId,
[completedSetup: true,
label: "${device.displayName} (CH2)",
isComponent: false]
)
}

Expand Down
11 changes: 8 additions & 3 deletions devicetypes/smartthings/aeon-key-fob.src/aeon-key-fob.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,14 @@ private void createChildDevices() {
Integer buttons = (device.currentState("numberOfButtons").value).toBigInteger()

for (i in 1..buttons) {
def child = addChildDevice("Child Button", "${device.deviceNetworkId}/${i}", null,
[completedSetup: true, label: "${device.displayName} button ${i}",
isComponent: true, componentName: "button$i", componentLabel: "Button $i"])
def child = addChildDevice("Child Button",
"${device.deviceNetworkId}/${i}",
device.hubId,
[completedSetup: true,
label: "${device.displayName} button ${i}",
isComponent: true,
componentName: "button$i",
componentLabel: "Button $i"])

child.sendEvent(name: "supportedButtonValues", value: JsonOutput.toJson(["pushed", "held"]), displayed: false)
child.sendEvent(name: "button", value: "pushed", data: [buttonNumber: 1], displayed: false)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -320,13 +320,15 @@ private updateLocalSwitchState(childId, state) {
private addChildSwitches() {
for (i in 2..5) {
String childDni = "${device.deviceNetworkId}/$i"
def child = addChildDevice("Child Switch", childDni, null, [
completedSetup: true,
label : "$device.displayName Switch $i",
isComponent : true,
componentName : "switch$i",
componentLabel: "Switch $i"
])
def child = addChildDevice("Child Switch",
childDni,
device.hubId,
[completedSetup: true,
label : "$device.displayName Switch $i",
isComponent : true,
componentName : "switch$i",
componentLabel: "Switch $i"
])
child.sendEvent(name: "switch", value: "off")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,14 @@ private void onOffCmd(value, endpoint = null) {
private void createChildDevices() {
state.oldLabel = device.label
for (i in 1..5) {
addChildDevice("Zooz Power Strip Outlet", "${device.deviceNetworkId}-ep${i}", null,
[completedSetup: true, label: "${device.displayName} (CH${i})",
isComponent: true, componentName: "ch$i", componentLabel: "Channel $i"])
addChildDevice("Zooz Power Strip Outlet",
"${device.deviceNetworkId}-ep${i}",
device.hubId,
[completedSetup: true,
label: "${device.displayName} (CH${i})",
isComponent: true,
componentName: "ch$i",
componentLabel: "Channel $i"])
}
}

Expand Down