Skip to content

Commit

Permalink
ICP-11574 - query device for current status in response to WakeUpNoti…
Browse files Browse the repository at this point in the history
…fication (#42036)

* ICP-11574 - query device for current status in response to WakeUpNotification
  • Loading branch information
KKlimczukS authored Aug 28, 2020
1 parent 5ea86c4 commit 8ae0948
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,16 @@ def zwaveEvent(physicalgraph.zwave.commands.sensoralarmv1.SensorAlarmReport cmd,
def zwaveEvent(physicalgraph.zwave.commands.wakeupv1.WakeUpNotification cmd, results) {
results << createEvent(descriptionText: "$device.displayName woke up", isStateChange: false)
if (!state.lastbatt || (now() - state.lastbatt) >= 56*60*60*1000) {
results << response([
results << response(delayBetween([
zwave.notificationV3.notificationGet(notificationType: 0x01).format(),
zwave.batteryV1.batteryGet().format(),
"delay 2000",
zwave.wakeUpV1.wakeUpNoMoreInformation().format()
])
]), 2000 )
} else {
results << response(zwave.wakeUpV1.wakeUpNoMoreInformation())
results << response(delayBetween([
zwave.notificationV3.notificationGet(notificationType: 0x01).format(),
zwave.wakeUpV1.wakeUpNoMoreInformation().format()
]), 2000 )
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,16 @@ def zwaveEvent(physicalgraph.zwave.commands.sensoralarmv1.SensorAlarmReport cmd,
def zwaveEvent(physicalgraph.zwave.commands.wakeupv1.WakeUpNotification cmd, results) {
results << createEvent(descriptionText: "$device.displayName woke up", isStateChange: false)
if (!state.lastbatt || (now() - state.lastbatt) >= 56*60*60*1000) {
results << response([
results << response(delayBetween([
zwave.notificationV3.notificationGet(notificationType: 0x01).format(),
zwave.batteryV1.batteryGet().format(),
"delay 2000",
zwave.wakeUpV1.wakeUpNoMoreInformation().format()
])
]), 2000 )
} else {
results << response(zwave.wakeUpV1.wakeUpNoMoreInformation())
results << response(delayBetween([
zwave.notificationV3.notificationGet(notificationType: 0x01).format(),
zwave.wakeUpV1.wakeUpNoMoreInformation().format()
]), 2000 )
}
}

Expand Down

0 comments on commit 8ae0948

Please sign in to comment.