Fix KNX issue if 0 kelvin is reported by device (#44392)
Co-authored-by: Matthias Alphart <farmio@alphart.net> Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
parent
67ed730c08
commit
ffbef0bcd1
1 changed files with 2 additions and 1 deletions
|
@ -86,7 +86,8 @@ class KNXLight(KnxEntity, LightEntity):
|
|||
"""Return the color temperature in mireds."""
|
||||
if self._device.supports_color_temperature:
|
||||
kelvin = self._device.current_color_temperature
|
||||
if kelvin is not None:
|
||||
# Avoid division by zero if actuator reported 0 Kelvin (e.g., uninitialized DALI-Gateway)
|
||||
if kelvin is not None and kelvin > 0:
|
||||
return color_util.color_temperature_kelvin_to_mired(kelvin)
|
||||
if self._device.supports_tunable_white:
|
||||
relative_ct = self._device.current_tunable_white
|
||||
|
|
Loading…
Add table
Reference in a new issue