mirror of
https://github.com/home-assistant/core.git
synced 2025-07-16 17:57:11 +00:00
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
@ -86,7 +86,8 @@ class KNXLight(KnxEntity, LightEntity):
|
|||||||
"""Return the color temperature in mireds."""
|
"""Return the color temperature in mireds."""
|
||||||
if self._device.supports_color_temperature:
|
if self._device.supports_color_temperature:
|
||||||
kelvin = self._device.current_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)
|
return color_util.color_temperature_kelvin_to_mired(kelvin)
|
||||||
if self._device.supports_tunable_white:
|
if self._device.supports_tunable_white:
|
||||||
relative_ct = self._device.current_tunable_white
|
relative_ct = self._device.current_tunable_white
|
||||||
|
Loading…
x
Reference in New Issue
Block a user