Read color temperature range from Matter device if supported (#122054)

This commit is contained in:
Stefan Agner 2024-07-17 00:25:28 +01:00 committed by GitHub
parent 1b6f880a27
commit 0aea9b0edb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -357,6 +357,16 @@ class MatterLight(MatterEntity, LightEntity):
):
supported_color_modes.add(ColorMode.COLOR_TEMP)
self._supports_color_temperature = True
min_mireds = self.get_matter_attribute_value(
clusters.ColorControl.Attributes.ColorTempPhysicalMinMireds
)
if min_mireds > 0:
self._attr_min_mireds = min_mireds
max_mireds = self.get_matter_attribute_value(
clusters.ColorControl.Attributes.ColorTempPhysicalMaxMireds
)
if min_mireds > 0:
self._attr_max_mireds = max_mireds
supported_color_modes = filter_supported_color_modes(supported_color_modes)
self._attr_supported_color_modes = supported_color_modes