Skip to content

Commit 951d41a

Browse files
authored
Fix auto update switch (python-kasa#786)
Set the attribute_setter. Also, (at least some) devices expect the full payload data so send it with.
1 parent 2b0721a commit 951d41a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

kasa/smart/modules/firmware.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ def __init__(self, device: "SmartDevice", module: str):
5454
"Auto update enabled",
5555
container=self,
5656
attribute_getter="auto_update_enabled",
57+
attribute_setter="set_auto_update_enabled",
5758
type=FeatureType.Switch,
5859
)
5960
)
@@ -101,4 +102,5 @@ def auto_update_enabled(self):
101102

102103
async def set_auto_update_enabled(self, enabled: bool):
103104
"""Change autoupdate setting."""
104-
await self.call("set_auto_update_info", {"enable": enabled})
105+
data = {**self.data["get_auto_update_info"], "enable": enabled}
106+
await self.call("set_auto_update_info", data) #{"enable": enabled})

0 commit comments

Comments
 (0)