Skip to content

Commit

Permalink
Merge pull request #1 from home-assistant/dev
Browse files Browse the repository at this point in the history
Remove async_update (home-assistant#9997)
  • Loading branch information
ImEmJay authored Oct 21, 2017
2 parents aab7442 + ce1a2cc commit a367c23
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions homeassistant/components/vacuum/xiaomi_miio.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,23 +363,17 @@ def async_remote_control_move_step(self,
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

0 comments on commit a367c23

Please sign in to comment.