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:
Vinay Rao
2017-04-03 16:48:44 -07:00
committed by GitHub

View File

@@ -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
} }