From 66f12afbb14e5f60e5fa505c7021e835ed50cb87 Mon Sep 17 00:00:00 2001 From: Erik Date: Mon, 4 Jan 2016 21:12:10 +0100 Subject: [PATCH] don't fail if error don't fail if request for updated data raises exception in underlying library --- homeassistant/components/sensor/eliqonline.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/sensor/eliqonline.py b/homeassistant/components/sensor/eliqonline.py index 891144c4b5f..f8aaf024813 100644 --- a/homeassistant/components/sensor/eliqonline.py +++ b/homeassistant/components/sensor/eliqonline.py @@ -46,6 +46,7 @@ class EliqSensor(Entity): self.api = api self.channel_id = channel_id + self.update() @property def name(self): @@ -69,5 +70,8 @@ class EliqSensor(Entity): def update(self): """ Gets the latest data. """ - response = self.api.get_data_now(channelid=self.channel_id) - self._state = int(response.power) + try: + response = self.api.get_data_now(channelid=self.channel_id) + self._state = int(response.power) + except: + pass