Fetch timers separately for xiaomi vacuums (#41330)

pull/41398/head
Teemu R 2020-10-06 15:26:59 +02:00 committed by GitHub
parent 6065ab118f
commit 46b2c776db
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 2 deletions

View File

@ -484,14 +484,21 @@ class MiroboVacuum(StateVacuumEntity):
self.last_clean = self._vacuum.last_clean_details()
self.dnd_state = self._vacuum.dnd_status()
self._timers = self._vacuum.timer()
self._available = True
except OSError as exc:
_LOGGER.error("Got OSError while fetching the state: %s", exc)
except DeviceException as exc:
_LOGGER.warning("Got exception while fetching the state: %s", exc)
# Fetch timers separately, see #38285
try:
self._timers = self._vacuum.timer()
except DeviceException as exc:
_LOGGER.debug(
"Unable to fetch timers, this may happen on some devices: %s", exc
)
self._timers = []
async def async_clean_zone(self, zone, repeats=1):
"""Clean selected area for the number of repeats indicated."""
for _zone in zone: