From d61eb93c033434e31c29c73591a6bc96a72e48e7 Mon Sep 17 00:00:00 2001 From: pavoni Date: Sat, 9 Jan 2016 16:16:41 +0000 Subject: [PATCH] Remove throttle doesn't play well with subscriptions. --- homeassistant/components/light/vera.py | 1 - homeassistant/components/switch/vera.py | 9 +-------- 2 files changed, 1 insertion(+), 9 deletions(-) diff --git a/homeassistant/components/light/vera.py b/homeassistant/components/light/vera.py index bcf27eab5f7..95e0d849762 100644 --- a/homeassistant/components/light/vera.py +++ b/homeassistant/components/light/vera.py @@ -86,5 +86,4 @@ class VeraLight(VeraSwitch): else: self.vera_device.switch_on() - self.last_command_send = time.time() self.is_on_status = True diff --git a/homeassistant/components/switch/vera.py b/homeassistant/components/switch/vera.py index 91a83086570..1f67d3cfa69 100644 --- a/homeassistant/components/switch/vera.py +++ b/homeassistant/components/switch/vera.py @@ -87,8 +87,6 @@ class VeraSwitch(ToggleEntity): else: self._name = self.vera_device.name self.is_on_status = False - # for debouncing status check after command is sent - self.last_command_send = 0 self.controller.register(vera_device) self.controller.on( @@ -132,12 +130,10 @@ class VeraSwitch(ToggleEntity): return attr def turn_on(self, **kwargs): - self.last_command_send = time.time() self.vera_device.switch_on() self.is_on_status = True def turn_off(self, **kwargs): - self.last_command_send = time.time() self.vera_device.switch_off() self.is_on_status = False @@ -152,10 +148,7 @@ class VeraSwitch(ToggleEntity): return self.is_on_status def update(self): - # We need to debounce the status call after turning switch on or off - # because the vera has some lag in updating the device status try: - if (self.last_command_send + 5) < time.time(): - self.is_on_status = self.vera_device.is_switched_on() + self.is_on_status = self.vera_device.is_switched_on() except RequestException: _LOGGER.warning('Could not update status for %s', self.name)