From a09b77274fb98531cf283bf0c55a29aafe4f6c67 Mon Sep 17 00:00:00 2001 From: Justin Stafford <64961256+JustinStafford@users.noreply.github.com> Date: Sun, 6 Sep 2026 15:37:25 +1000 Subject: [PATCH] Fix BAF color temperature support on fan-mounted lights Select the light class from the reported color temperature range rather than from whether the device has a fan, and correct the inverted Kelvin bounds. --- homeassistant/components/baf/light.py | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/baf/light.py b/homeassistant/components/baf/light.py index 151f197c47c1c..db6f6372fb50d 100644 --- a/homeassistant/components/baf/light.py +++ b/homeassistant/components/baf/light.py @@ -25,7 +25,12 @@ async def async_setup_entry( """Set up BAF lights.""" device = entry.runtime_data if device.has_light: - klass = BAFFanLight if device.has_fan else BAFStandaloneLight + klass = ( + BAFColorTempLight + if device.light_warmest_color_temperature + and device.light_coolest_color_temperature + else BAFBrightnessLight + ) async_add_entities([klass(device)]) @@ -58,24 +63,26 @@ async def async_turn_off(self, **kwargs: Any) -> None: self._device.light_mode = OffOnAuto.OFF -class BAFFanLight(BAFLight): - """Representation of a Big Ass Fans light on a fan.""" +class BAFBrightnessLight(BAFLight): + """Representation of a Big Ass Fans light without color temperature.""" _attr_supported_color_modes = {ColorMode.BRIGHTNESS} _attr_color_mode = ColorMode.BRIGHTNESS -class BAFStandaloneLight(BAFLight): - """Representation of a Big Ass Fans light.""" +class BAFColorTempLight(BAFLight): + """Representation of a Big Ass Fans light with color temperature.""" _attr_supported_color_modes = {ColorMode.COLOR_TEMP} _attr_color_mode = ColorMode.COLOR_TEMP def __init__(self, device: Device) -> None: - """Init a standalone light.""" + """Init a light with color temperature.""" super().__init__(device) - self._attr_max_color_temp_kelvin = device.light_warmest_color_temperature - self._attr_min_color_temp_kelvin = device.light_coolest_color_temperature + warmest = device.light_warmest_color_temperature + coolest = device.light_coolest_color_temperature + self._attr_min_color_temp_kelvin = min(warmest, coolest) + self._attr_max_color_temp_kelvin = max(warmest, coolest) @callback @override