mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-03-24 05:04:10 +00:00
CHF-348 Philips Hue: Change offline time to 16 min
This commit is contained in:
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
@@ -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)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user