Fix unit and wrong errorhandling
This commit is contained in:
parent
c584b6b28d
commit
a29be5455c
2 changed files with 2 additions and 5 deletions
|
@ -128,10 +128,7 @@ class VerisureMouseDetection(Entity):
|
|||
@property
|
||||
def unit_of_measurement(self):
|
||||
""" Unit of measurement of this entity """
|
||||
if verisure.MOUSEDETECTION_STATUS[self._id].count >= 1:
|
||||
return "Mice"
|
||||
else:
|
||||
return "Mouse"
|
||||
return "Mice"
|
||||
|
||||
def update(self):
|
||||
""" update sensor """
|
||||
|
|
|
@ -164,7 +164,7 @@ def update_component(get_function, status):
|
|||
for overview in get_function():
|
||||
try:
|
||||
status[overview.id] = overview
|
||||
except IndexError:
|
||||
except AttributeError:
|
||||
status[overview.deviceLabel] = overview
|
||||
except (ConnectionError, VERISURE_ERROR) as ex:
|
||||
_LOGGER.error('Caught connection error %s, tries to reconnect', ex)
|
||||
|
|
Loading…
Add table
Reference in a new issue