Revert "Revert "Added health-check for Logitech Harmony Hub""

This commit is contained in:
Vinay Rao
2017-04-04 14:38:11 -07:00
committed by GitHub
parent a397fe9fc3
commit 2fd8cf1416
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}")