CHF-348 Philips Hue: Change offline time to 16 min

This commit is contained in:
Lars Finander
2016-09-12 17:08:57 -06:00
parent 570922e2ac
commit 079919260b
5 changed files with 10 additions and 10 deletions

View File

@@ -57,7 +57,7 @@ metadata {
} }
void installed() { void installed() {
sendEvent(name: "checkInterval", value: 60 * 30, data: [protocol: "lan"], displayed: false) sendEvent(name: "checkInterval", value: 60 * 15, data: [protocol: "lan"], displayed: false)
} }
// parse events into attributes // parse events into attributes

View File

@@ -66,7 +66,7 @@ metadata {
} }
void installed() { void installed() {
sendEvent(name: "checkInterval", value: 60 * 30, data: [protocol: "lan"], displayed: false) sendEvent(name: "checkInterval", value: 60 * 15, data: [protocol: "lan"], displayed: false)
} }
// parse events into attributes // parse events into attributes

View File

@@ -50,7 +50,7 @@ metadata {
} }
void installed() { void installed() {
sendEvent(name: "checkInterval", value: 60 * 30, data: [protocol: "lan"], displayed: false) sendEvent(name: "checkInterval", value: 60 * 15, data: [protocol: "lan"], displayed: false)
} }
// parse events into attributes // parse events into attributes

View File

@@ -55,7 +55,7 @@ metadata {
} }
void installed() { void installed() {
sendEvent(name: "checkInterval", value: 60 * 30, data: [protocol: "lan"], displayed: false) sendEvent(name: "checkInterval", value: 60 * 15, data: [protocol: "lan"], displayed: false)
} }
// parse events into attributes // parse events into attributes

View File

@@ -724,13 +724,13 @@ private void updateBridgeStatus(childDevice) {
} }
/** /**
* Check if all Hue bridges have been heard from in the last 16 minutes, if not an Offline event will be sent * Check if all Hue bridges have been heard from in the last 11 minutes, if not an Offline event will be sent
* for the bridge. Also, set ID number on bridge if not done previously. * for the bridge and all connected lights. Also, set ID number on bridge if not done previously.
*/ */
private void checkBridgeStatus() { private void checkBridgeStatus() {
def bridges = getHueBridges() def bridges = getHueBridges()
// Check if each bridge has been heard from within the last 16 minutes (3 poll intervals times 5 minutes plus buffer) // Check if each bridge has been heard from within the last 11 minutes (2 poll intervals times 5 minutes plus buffer)
def time = now() - (1000 * 60 * 30) def time = now() - (1000 * 60 * 11)
bridges.each { bridges.each {
def d = getChildDevice(it.value.mac) def d = getChildDevice(it.value.mac)
if(d) { if(d) {
@@ -748,7 +748,7 @@ private void checkBridgeStatus() {
it.value.online = false it.value.online = false
} }
getChildDevices().each { getChildDevices().each {
it.sendEvent(name: "DeviceWatch-DeviceOffline", value: "offline") it.sendEvent(name: "DeviceWatch-DeviceOffline", value: "offline", isStateChange: true, displayed: false)
} }
} else { } else {
d.sendEvent(name: "status", value: "Online")//setOnline(false) d.sendEvent(name: "status", value: "Online")//setOnline(false)
@@ -960,7 +960,7 @@ private handlePoll(body) {
} else { } else {
state.bulbs[bulb.key]?.online = false state.bulbs[bulb.key]?.online = false
log.warn "$device is not reachable by Hue bridge" log.warn "$device is not reachable by Hue bridge"
device.sendEvent(name: "DeviceWatch-DeviceOffline", value: "offline") device.sendEvent(name: "DeviceWatch-DeviceOffline", value: "offline", displayed: false, isStateChange: true)
} }
} }
} }