Add exception handler for vera timeout

pull/668/head
pavoni 2015-11-27 11:43:43 +00:00
parent 4c3d6981a6
commit 7204bc018f
1 changed files with 5 additions and 2 deletions

View File

@ -126,5 +126,8 @@ class VeraSwitch(ToggleEntity):
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()
except RequestException:
_LOGGER.warning('Could not update status for %s', self.name)