From 95bbea20a87dc321b252a2be19cee06c5dcbfcdb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20H=C3=B8yer=20Iversen?= Date: Wed, 24 Apr 2019 04:23:52 +0200 Subject: [PATCH] Fix Switchbot restore state (#23325) * switchbot library * req * req * issue #23039 --- homeassistant/components/switchbot/manifest.json | 2 +- homeassistant/components/switchbot/switch.py | 2 +- requirements_all.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/switchbot/manifest.json b/homeassistant/components/switchbot/manifest.json index 0143855db37..21ac6ad833e 100644 --- a/homeassistant/components/switchbot/manifest.json +++ b/homeassistant/components/switchbot/manifest.json @@ -3,7 +3,7 @@ "name": "Switchbot", "documentation": "https://www.home-assistant.io/components/switchbot", "requirements": [ - "PySwitchbot==0.5" + "PySwitchbot==0.6" ], "dependencies": [], "codeowners": [ diff --git a/homeassistant/components/switchbot/switch.py b/homeassistant/components/switchbot/switch.py index b8a2a905dcb..c29dfea6737 100644 --- a/homeassistant/components/switchbot/switch.py +++ b/homeassistant/components/switchbot/switch.py @@ -46,7 +46,7 @@ class SwitchBot(SwitchDevice, RestoreEntity): state = await self.async_get_last_state() if not state: return - self._state = state.state + self._state = state.state == 'on' def turn_on(self, **kwargs) -> None: """Turn device on.""" diff --git a/requirements_all.txt b/requirements_all.txt index e53402d49a3..eb6e3cd7bee 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -64,7 +64,7 @@ PyQRCode==1.2.1 PyRMVtransport==0.1.3 # homeassistant.components.switchbot -# PySwitchbot==0.5 +# PySwitchbot==0.6 # homeassistant.components.transport_nsw PyTransportNSW==0.1.1