@@ -64,7 +64,8 @@ def __init__(
6464 self ._attr_color_mode = self ._detect_color_mode (config )
6565 self ._attr_supported_color_modes = {self ._attr_color_mode }
6666
67- # Set min/max kelvin values if the mode is COLOR_TEMP
67+ self ._attr_min_color_temp_kelvin : int = LIGHT_DEFAULT_MIN_KELVIN
68+ self ._attr_max_color_temp_kelvin : int = LIGHT_DEFAULT_MAX_KELVIN
6869 if self ._attr_color_mode == ColorMode .COLOR_TEMP :
6970 self ._attr_min_color_temp_kelvin = config .get (
7071 CONF_MIN_TEMP , LIGHT_DEFAULT_MIN_KELVIN
@@ -193,9 +194,6 @@ def _convert_modbus_percent_to_brightness(percent: int) -> int:
193194
194195 def _convert_modbus_percent_to_temperature (self , percent : int ) -> int :
195196 """Convert Modbus scale (0-100) to the color temperature in Kelvin (2000-7000 К)."""
196- assert isinstance (self ._attr_min_color_temp_kelvin , int ) and isinstance (
197- self ._attr_max_color_temp_kelvin , int
198- )
199197 return round (
200198 self ._attr_min_color_temp_kelvin
201199 + (
@@ -216,9 +214,6 @@ def _convert_brightness_to_modbus(brightness: int) -> int:
216214
217215 def _convert_color_temp_to_modbus (self , kelvin : int ) -> int :
218216 """Convert color temperature from Kelvin to the Modbus scale (0-100)."""
219- assert isinstance (self ._attr_min_color_temp_kelvin , int ) and isinstance (
220- self ._attr_max_color_temp_kelvin , int
221- )
222217 return round (
223218 LIGHT_MODBUS_SCALE_MIN
224219 + (kelvin - self ._attr_min_color_temp_kelvin )
0 commit comments