Skip to content

Commit

Permalink
Fix auto update switch (#786)
Browse files Browse the repository at this point in the history
Set the attribute_setter. Also, (at least some) devices expect the full payload data so send it with.
  • Loading branch information
rytilahti committed Feb 22, 2024
1 parent 2b0721a commit 951d41a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion kasa/smart/modules/firmware.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def __init__(self, device: "SmartDevice", module: str):
"Auto update enabled",
container=self,
attribute_getter="auto_update_enabled",
attribute_setter="set_auto_update_enabled",
type=FeatureType.Switch,
)
)
Expand Down Expand Up @@ -101,4 +102,5 @@ def auto_update_enabled(self):

async def set_auto_update_enabled(self, enabled: bool):
"""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})

0 comments on commit 951d41a

Please sign in to comment.