mirror of
https://github.com/python-kasa/python-kasa.git
synced 2024-12-23 03:33:35 +00:00
Fix auto update switch (#786)
Set the attribute_setter. Also, (at least some) devices expect the full payload data so send it with.
This commit is contained in:
parent
2b0721aea9
commit
951d41a628
@ -54,6 +54,7 @@ class Firmware(SmartModule):
|
|||||||
"Auto update enabled",
|
"Auto update enabled",
|
||||||
container=self,
|
container=self,
|
||||||
attribute_getter="auto_update_enabled",
|
attribute_getter="auto_update_enabled",
|
||||||
|
attribute_setter="set_auto_update_enabled",
|
||||||
type=FeatureType.Switch,
|
type=FeatureType.Switch,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@ -101,4 +102,5 @@ class Firmware(SmartModule):
|
|||||||
|
|
||||||
async def set_auto_update_enabled(self, enabled: bool):
|
async def set_auto_update_enabled(self, enabled: bool):
|
||||||
"""Change autoupdate setting."""
|
"""Change autoupdate setting."""
|
||||||
await self.call("set_auto_update_info", {"enable": enabled})
|
data = {**self.data["get_auto_update_info"], "enable": enabled}
|
||||||
|
await self.call("set_auto_update_info", data) #{"enable": enabled})
|
||||||
|
Loading…
Reference in New Issue
Block a user