Add colortemp feature for iot devices (#827)

Make color temperature feature available for iot bulbs.
This commit is contained in:
Teemu R
2024-03-26 19:33:10 +01:00
committed by GitHub
parent 35dbda7049
commit c08b58cd8b
2 changed files with 13 additions and 5 deletions

View File

@@ -221,6 +221,19 @@ class IotBulb(IotDevice, Bulb):
)
)
if self.is_variable_color_temp:
self._add_feature(
Feature(
device=self,
name="Color temperature",
container=self,
attribute_getter="color_temp",
attribute_setter="set_color_temp",
range_getter="valid_temperature_range",
)
)
@property # type: ignore
@requires_update
def is_color(self) -> bool: