Check the ct range for color temp support (#619)

This commit is contained in:
Teemu R 2024-01-04 19:28:48 +01:00 committed by GitHub
parent b156defc3c
commit 7a3eedeee9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,8 +32,9 @@ class TapoBulb(TapoDevice, SmartBulb):
@property @property
def is_variable_color_temp(self) -> bool: def is_variable_color_temp(self) -> bool:
"""Whether the bulb supports color temperature changes.""" """Whether the bulb supports color temperature changes."""
# TODO: this makes an assumption, that only ct bulbs report this ct = self._info.get("color_temp_range")
return bool(self._info.get("color_temp_range", False)) # L900 reports [9000, 9000] even when it doesn't support changing the ct
return ct is not None and ct[0] != ct[1]
@property @property
def valid_temperature_range(self) -> ColorTempRange: def valid_temperature_range(self) -> ColorTempRange: