Increased delay to mark device as offline

This commit is contained in:
Juan Risso
2016-01-08 16:01:57 -05:00
parent 6abf8c7f20
commit 26ab32565b
3 changed files with 7 additions and 7 deletions

View File

@@ -273,7 +273,7 @@ User-Agent: CyberGarage-HTTP/1.0
def poll() { def poll() {
log.debug "Executing 'poll'" log.debug "Executing 'poll'"
if (device.currentValue("currentIP") != "Offline") if (device.currentValue("currentIP") != "Offline")
runIn(10, setOffline) runIn(30, setOffline)
new physicalgraph.device.HubAction("""POST /upnp/control/basicevent1 HTTP/1.1 new physicalgraph.device.HubAction("""POST /upnp/control/basicevent1 HTTP/1.1
SOAPACTION: "urn:Belkin:service:basicevent:1#GetBinaryState" SOAPACTION: "urn:Belkin:service:basicevent:1#GetBinaryState"
Content-Length: 277 Content-Length: 277

View File

@@ -77,9 +77,8 @@ def parse(String description) {
def result = [] def result = []
def bodyString = msg.body def bodyString = msg.body
if (bodyString) { if (bodyString) {
unschedule("setOffline") unschedule("setOffline")
def body = new XmlSlurper().parseText(bodyString) def body = new XmlSlurper().parseText(bodyString)
if (body?.property?.TimeSyncRequest?.text()) { if (body?.property?.TimeSyncRequest?.text()) {
log.trace "Got TimeSyncRequest" log.trace "Got TimeSyncRequest"
result << timeSyncResponse() result << timeSyncResponse()
@@ -134,7 +133,7 @@ def refresh() {
def getStatus() { def getStatus() {
log.debug "Executing WeMo Motion 'getStatus'" log.debug "Executing WeMo Motion 'getStatus'"
if (device.currentValue("currentIP") != "Offline") if (device.currentValue("currentIP") != "Offline")
runIn(10, setOffline) runIn(30, setOffline)
new physicalgraph.device.HubAction("""POST /upnp/control/basicevent1 HTTP/1.1 new physicalgraph.device.HubAction("""POST /upnp/control/basicevent1 HTTP/1.1
SOAPACTION: "urn:Belkin:service:basicevent:1#GetBinaryState" SOAPACTION: "urn:Belkin:service:basicevent:1#GetBinaryState"
Content-Length: 277 Content-Length: 277

View File

@@ -28,6 +28,7 @@
command "subscribe" command "subscribe"
command "resubscribe" command "resubscribe"
command "unsubscribe" command "unsubscribe"
command "setOffline"
} }
// simulator metadata // simulator metadata
@@ -275,7 +276,7 @@ def setOffline() {
def poll() { def poll() {
log.debug "Executing 'poll'" log.debug "Executing 'poll'"
if (device.currentValue("currentIP") != "Offline") if (device.currentValue("currentIP") != "Offline")
runIn(10, setOffline) runIn(30, setOffline)
new physicalgraph.device.HubAction("""POST /upnp/control/basicevent1 HTTP/1.1 new physicalgraph.device.HubAction("""POST /upnp/control/basicevent1 HTTP/1.1
SOAPACTION: "urn:Belkin:service:basicevent:1#GetBinaryState" SOAPACTION: "urn:Belkin:service:basicevent:1#GetBinaryState"
Content-Length: 277 Content-Length: 277