From b4f392b181fd5f87ea1ac0f1c7029cce9e90f33c Mon Sep 17 00:00:00 2001 From: Teemu R Date: Sat, 22 Jul 2017 19:36:14 +0200 Subject: [PATCH] bump python-mirobo version for more robust protocol handling, make the platform to update on startup (#8602) --- homeassistant/components/switch/xiaomi_vacuum.py | 8 ++++---- requirements_all.txt | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/switch/xiaomi_vacuum.py b/homeassistant/components/switch/xiaomi_vacuum.py index 20906dd8df1..393cabb72b9 100644 --- a/homeassistant/components/switch/xiaomi_vacuum.py +++ b/homeassistant/components/switch/xiaomi_vacuum.py @@ -22,7 +22,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({ vol.Optional(CONF_NAME): cv.string, }) -REQUIREMENTS = ['python-mirobo==0.1.1'] +REQUIREMENTS = ['python-mirobo==0.1.2'] # pylint: disable=unused-argument @@ -32,7 +32,7 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None): name = config.get(CONF_NAME) token = config.get(CONF_TOKEN) - add_devices_callback([MiroboSwitch(name, host, token)]) + add_devices_callback([MiroboSwitch(name, host, token)], True) class MiroboSwitch(SwitchDevice): @@ -107,7 +107,7 @@ class MiroboSwitch(SwitchDevice): def update(self): """Fetch state from the device.""" - from mirobo import VacuumException + from mirobo import DeviceException try: state = self.vacuum.status() _LOGGER.debug("got state from the vacuum: %s", state) @@ -120,5 +120,5 @@ class MiroboSwitch(SwitchDevice): self._state = state.state_code self._is_on = state.is_on - except VacuumException as ex: + except DeviceException as ex: _LOGGER.error("Got exception while fetching the state: %s", ex) diff --git a/requirements_all.txt b/requirements_all.txt index 6bfc3a70ee6..8e5d3d52fa3 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -718,7 +718,7 @@ python-juicenet==0.0.5 # python-lirc==1.2.3 # homeassistant.components.switch.xiaomi_vacuum -python-mirobo==0.1.1 +python-mirobo==0.1.2 # homeassistant.components.media_player.mpd python-mpd2==0.5.5