Added health-check for Logitech Harmony Hub

This commit is contained in:
Parijat Das
2017-03-22 16:57:11 -07:00
parent 78a509e8f5
commit cbd15ae9cc
2 changed files with 19 additions and 0 deletions

View File

@@ -511,6 +511,10 @@ def pollResponse(response, data) {
if (ResponseValues) {
def map = [:]
ResponseValues.hubs.each {
// Device-Watch relies on the Logitech Harmony Cloud to get the Device state.
def isAlive = it.value.status
def d = getChildDevice("harmony-${it.key}")
d?.sendEvent(name: "DeviceWatch-DeviceStatus", value: isAlive!=504? "online":"offline", displayed: false, isStateChange: true)
if (it.value.message == "OK") {
map["${it.key}"] = "${it.value.response.data.currentAvActivity},${it.value.response.data.activityStatus}"
def hub = getChildDevice("harmony-${it.key}")