From bc1503c40e249ad76fed6a5c00f502cf775ec4f9 Mon Sep 17 00:00:00 2001 From: Steven B <51370195+sdb9696@users.noreply.github.com> Date: Mon, 29 Jan 2024 18:52:22 +0000 Subject: [PATCH] Fix TapoBulb state information for non-dimmable SMARTSWITCH (#726) --- kasa/tapo/tapobulb.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kasa/tapo/tapobulb.py b/kasa/tapo/tapobulb.py index bbaf093d..cfd5768f 100644 --- a/kasa/tapo/tapobulb.py +++ b/kasa/tapo/tapobulb.py @@ -243,9 +243,10 @@ class TapoBulb(TapoDevice, SmartBulb): info: Dict[str, Any] = { # TODO: re-enable after we don't inherit from smartbulb # **super().state_information - "Brightness": self.brightness, "Is dimmable": self.is_dimmable, } + if self.is_dimmable: + info["Brightness"] = self.brightness if self.is_variable_color_temp: info["Color temperature"] = self.color_temp info["Valid temperature range"] = self.valid_temperature_range