mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 17:57:11 +00:00
don't fail if error
don't fail if request for updated data raises exception in underlying library
This commit is contained in:
parent
a174a06e5c
commit
66f12afbb1
@ -46,6 +46,7 @@ class EliqSensor(Entity):
|
|||||||
|
|
||||||
self.api = api
|
self.api = api
|
||||||
self.channel_id = channel_id
|
self.channel_id = channel_id
|
||||||
|
self.update()
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
@ -69,5 +70,8 @@ class EliqSensor(Entity):
|
|||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
""" Gets the latest data. """
|
""" Gets the latest data. """
|
||||||
response = self.api.get_data_now(channelid=self.channel_id)
|
try:
|
||||||
self._state = int(response.power)
|
response = self.api.get_data_now(channelid=self.channel_id)
|
||||||
|
self._state = int(response.power)
|
||||||
|
except:
|
||||||
|
pass
|
||||||
|
Loading…
x
Reference in New Issue
Block a user