Remove switch state delay
This commit is contained in:
parent
78f7c3cbea
commit
15012688f2
1 changed files with 0 additions and 10 deletions
10
homeassistant/external/wink/pywink.py
vendored
10
homeassistant/external/wink/pywink.py
vendored
|
@ -87,8 +87,6 @@ class wink_sensor_pod(object):
|
||||||
def __init__(self, aJSonObj, objectprefix="sensor_pods"):
|
def __init__(self, aJSonObj, objectprefix="sensor_pods"):
|
||||||
self.jsonState = aJSonObj
|
self.jsonState = aJSonObj
|
||||||
self.objectprefix = objectprefix
|
self.objectprefix = objectprefix
|
||||||
# Tuple (desired state, time)
|
|
||||||
self._last_call = (0, None)
|
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return "%s %s %s" % (self.name(), self.deviceId(), self.state())
|
return "%s %s %s" % (self.name(), self.deviceId(), self.state())
|
||||||
|
@ -104,11 +102,6 @@ class wink_sensor_pod(object):
|
||||||
return self.jsonState.get('name', "Unknown Name")
|
return self.jsonState.get('name', "Unknown Name")
|
||||||
|
|
||||||
def state(self):
|
def state(self):
|
||||||
# Optimistic approach to setState:
|
|
||||||
# Within 15 seconds of a call to setState we assume it worked.
|
|
||||||
if self._recent_state_set():
|
|
||||||
return self._last_call[1]
|
|
||||||
|
|
||||||
return self._last_reading.get('opened', False)
|
return self._last_reading.get('opened', False)
|
||||||
|
|
||||||
def deviceId(self):
|
def deviceId(self):
|
||||||
|
@ -135,9 +128,6 @@ class wink_sensor_pod(object):
|
||||||
"""
|
"""
|
||||||
self.jsonState = response_json.get('data')
|
self.jsonState = response_json.get('data')
|
||||||
|
|
||||||
def _recent_state_set(self):
|
|
||||||
return time.time() - self._last_call[0] < 15
|
|
||||||
|
|
||||||
class wink_binary_switch(object):
|
class wink_binary_switch(object):
|
||||||
""" represents a wink.py switch
|
""" represents a wink.py switch
|
||||||
json_obj holds the json stat at init (and if there is a refresh it's updated
|
json_obj holds the json stat at init (and if there is a refresh it's updated
|
||||||
|
|
Loading…
Add table
Reference in a new issue