Fix Switchbot restore state (#23325)
* switchbot library * req * req * issue #23039
This commit is contained in:
parent
662375bdd7
commit
95bbea20a8
3 changed files with 3 additions and 3 deletions
|
@ -3,7 +3,7 @@
|
||||||
"name": "Switchbot",
|
"name": "Switchbot",
|
||||||
"documentation": "https://www.home-assistant.io/components/switchbot",
|
"documentation": "https://www.home-assistant.io/components/switchbot",
|
||||||
"requirements": [
|
"requirements": [
|
||||||
"PySwitchbot==0.5"
|
"PySwitchbot==0.6"
|
||||||
],
|
],
|
||||||
"dependencies": [],
|
"dependencies": [],
|
||||||
"codeowners": [
|
"codeowners": [
|
||||||
|
|
|
@ -46,7 +46,7 @@ class SwitchBot(SwitchDevice, RestoreEntity):
|
||||||
state = await self.async_get_last_state()
|
state = await self.async_get_last_state()
|
||||||
if not state:
|
if not state:
|
||||||
return
|
return
|
||||||
self._state = state.state
|
self._state = state.state == 'on'
|
||||||
|
|
||||||
def turn_on(self, **kwargs) -> None:
|
def turn_on(self, **kwargs) -> None:
|
||||||
"""Turn device on."""
|
"""Turn device on."""
|
||||||
|
|
|
@ -64,7 +64,7 @@ PyQRCode==1.2.1
|
||||||
PyRMVtransport==0.1.3
|
PyRMVtransport==0.1.3
|
||||||
|
|
||||||
# homeassistant.components.switchbot
|
# homeassistant.components.switchbot
|
||||||
# PySwitchbot==0.5
|
# PySwitchbot==0.6
|
||||||
|
|
||||||
# homeassistant.components.transport_nsw
|
# homeassistant.components.transport_nsw
|
||||||
PyTransportNSW==0.1.1
|
PyTransportNSW==0.1.1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue