Fix TapoBulb state information for non-dimmable SMARTSWITCH (#726)

This commit is contained in:
Steven B 2024-01-29 18:52:22 +00:00 committed by GitHub
parent f8e273981c
commit bc1503c40e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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