From ce1a2cc2a6d03e099fded51c5b64186bc8230d18 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Sat, 21 Oct 2017 09:45:05 +0200 Subject: [PATCH] Remove async_update (#9997) --- homeassistant/components/vacuum/xiaomi_miio.py | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/homeassistant/components/vacuum/xiaomi_miio.py b/homeassistant/components/vacuum/xiaomi_miio.py index 5747dd1dc9e..37d7be38f9d 100644 --- a/homeassistant/components/vacuum/xiaomi_miio.py +++ b/homeassistant/components/vacuum/xiaomi_miio.py @@ -363,23 +363,17 @@ class MiroboVacuum(VacuumDevice): self._vacuum.manual_control_once, velocity=velocity, rotation=rotation, duration=duration) - @asyncio.coroutine - def async_update(self): + def update(self): """Fetch state from the device.""" from mirobo import DeviceException try: - state = yield from self.hass.async_add_job(self._vacuum.status) - _LOGGER.debug("Got new state from the vacuum: %s", state.data) + state = self._vacuum.status() self.vacuum_state = state - self.consumable_state = yield from self.hass.async_add_job( - self._vacuum.consumable_status) - self.clean_history = yield from self.hass.async_add_job( - self._vacuum.clean_history) + self.consumable_state = self._vacuum.consumable_status() + self.clean_history = self._vacuum.clean_history() self._is_on = state.is_on self._available = True except OSError as exc: _LOGGER.error("Got OSError while fetching the state: %s", exc) - # self._available = False except DeviceException as exc: _LOGGER.warning("Got exception while fetching the state: %s", exc) - # self._available = False