mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-04-06 06:13:07 +01:00
Merge pull request #1868 from bflorian/DVCSMP-2399-zooz-zen20-staging
DVCSMP Check for null device and send refresh() from configure()
This commit is contained in:
@@ -25,6 +25,7 @@ metadata {
|
|||||||
capability "Refresh"
|
capability "Refresh"
|
||||||
capability "Actuator"
|
capability "Actuator"
|
||||||
capability "Sensor"
|
capability "Sensor"
|
||||||
|
capability "Configuration"
|
||||||
|
|
||||||
fingerprint manufacturer: "015D", prod: "0651", model: "F51C", deviceJoinName: "Zooz ZEN 20 Power Strip"
|
fingerprint manufacturer: "015D", prod: "0651", model: "F51C", deviceJoinName: "Zooz ZEN 20 Power Strip"
|
||||||
}
|
}
|
||||||
@@ -65,6 +66,10 @@ def updated() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def configure() {
|
||||||
|
refresh()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//////////////////////
|
//////////////////////
|
||||||
// Event Generation //
|
// Event Generation //
|
||||||
@@ -107,6 +112,7 @@ def zwaveBinaryEvent(cmd, endpoint) {
|
|||||||
def result = []
|
def result = []
|
||||||
def children = childDevices
|
def children = childDevices
|
||||||
def childDevice = children.find{it.deviceNetworkId.endsWith("$endpoint")}
|
def childDevice = children.find{it.deviceNetworkId.endsWith("$endpoint")}
|
||||||
|
if (childDevice) {
|
||||||
childDevice.sendEvent(name: "switch", value: cmd.value ? "on" : "off")
|
childDevice.sendEvent(name: "switch", value: cmd.value ? "on" : "off")
|
||||||
|
|
||||||
if (cmd.value) {
|
if (cmd.value) {
|
||||||
@@ -118,6 +124,7 @@ def zwaveBinaryEvent(cmd, endpoint) {
|
|||||||
result << createEvent(name: "switch", value: "off")
|
result << createEvent(name: "switch", value: "off")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
result
|
result
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user