mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 06:07:17 +00:00
Remove async_update (#9997)
This commit is contained in:
parent
aab7442cc5
commit
ce1a2cc2a6
@ -363,23 +363,17 @@ class MiroboVacuum(VacuumDevice):
|
|||||||
self._vacuum.manual_control_once,
|
self._vacuum.manual_control_once,
|
||||||
velocity=velocity, rotation=rotation, duration=duration)
|
velocity=velocity, rotation=rotation, duration=duration)
|
||||||
|
|
||||||
@asyncio.coroutine
|
def update(self):
|
||||||
def async_update(self):
|
|
||||||
"""Fetch state from the device."""
|
"""Fetch state from the device."""
|
||||||
from mirobo import DeviceException
|
from mirobo import DeviceException
|
||||||
try:
|
try:
|
||||||
state = yield from self.hass.async_add_job(self._vacuum.status)
|
state = self._vacuum.status()
|
||||||
_LOGGER.debug("Got new state from the vacuum: %s", state.data)
|
|
||||||
self.vacuum_state = state
|
self.vacuum_state = state
|
||||||
self.consumable_state = yield from self.hass.async_add_job(
|
self.consumable_state = self._vacuum.consumable_status()
|
||||||
self._vacuum.consumable_status)
|
self.clean_history = self._vacuum.clean_history()
|
||||||
self.clean_history = yield from self.hass.async_add_job(
|
|
||||||
self._vacuum.clean_history)
|
|
||||||
self._is_on = state.is_on
|
self._is_on = state.is_on
|
||||||
self._available = True
|
self._available = True
|
||||||
except OSError as exc:
|
except OSError as exc:
|
||||||
_LOGGER.error("Got OSError while fetching the state: %s", exc)
|
_LOGGER.error("Got OSError while fetching the state: %s", exc)
|
||||||
# self._available = False
|
|
||||||
except DeviceException as exc:
|
except DeviceException as exc:
|
||||||
_LOGGER.warning("Got exception while fetching the state: %s", exc)
|
_LOGGER.warning("Got exception while fetching the state: %s", exc)
|
||||||
# self._available = False
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user