Smart outlet heartbeat fix

-Readded heartbeat calls that were accidentally removed.
This commit is contained in:
larsfinander
2015-08-29 20:26:44 -07:00
parent b611794854
commit 45da8e9fee

View File

@@ -69,6 +69,9 @@ metadata {
def parse(String description) { def parse(String description) {
log.debug "description is $description" log.debug "description is $description"
// save heartbeat (i.e. last time we got a message from device)
state.heartbeat = Calendar.getInstance().getTimeInMillis()
def finalResult = zigbee.getKnownDescription(description) def finalResult = zigbee.getKnownDescription(description)
//TODO: Remove this after getKnownDescription can parse it automatically //TODO: Remove this after getKnownDescription can parse it automatically
@@ -109,6 +112,7 @@ def on() {
} }
def refresh() { def refresh() {
sendEvent(name: "heartbeat", value: "alive", displayed:false)
zigbee.onOffRefresh() + zigbee.refreshData("0x0B04", "0x050B") zigbee.onOffRefresh() + zigbee.refreshData("0x0B04", "0x050B")
} }