From 0817908ce8e8da8b70fa9bd3ff1f91ea47890cea Mon Sep 17 00:00:00 2001 From: Teemu Rytilahti Date: Thu, 22 Feb 2024 15:00:54 +0100 Subject: [PATCH] Fix auto update switch Set the attribute_setter. Also, (at least some) devices expect the full payload data. --- kasa/smart/modules/firmware.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kasa/smart/modules/firmware.py b/kasa/smart/modules/firmware.py index 541b0b7ab..80eca4df1 100644 --- a/kasa/smart/modules/firmware.py +++ b/kasa/smart/modules/firmware.py @@ -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, ) ) @@ -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})