From ce6154839ee44d2a7d8cc287e5902027d957bf64 Mon Sep 17 00:00:00 2001 From: Samuel Xiao <40679757+XiaoLing-git@users.noreply.github.com> Date: Mon, 9 Mar 2026 22:50:02 +0800 Subject: [PATCH] Switchbot Cloud: Fixed light mode settings error (#164723) --- homeassistant/components/switchbot_cloud/light.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/homeassistant/components/switchbot_cloud/light.py b/homeassistant/components/switchbot_cloud/light.py index 5e6103846de..d3bf22beebb 100644 --- a/homeassistant/components/switchbot_cloud/light.py +++ b/homeassistant/components/switchbot_cloud/light.py @@ -58,6 +58,8 @@ class SwitchBotCloudLight(SwitchBotCloudEntity, LightEntity): """Return the default color mode.""" if not self.supported_color_modes: return ColorMode.UNKNOWN + if ColorMode.BRIGHTNESS in self.supported_color_modes: + return ColorMode.BRIGHTNESS if ColorMode.RGB in self.supported_color_modes: return ColorMode.RGB if ColorMode.COLOR_TEMP in self.supported_color_modes: @@ -136,6 +138,7 @@ class SwitchBotCloudCandleWarmerLamp(SwitchBotCloudLight): # Brightness adjustment _attr_supported_color_modes = {ColorMode.BRIGHTNESS} + _attr_color_mode = ColorMode.BRIGHTNESS class SwitchBotCloudStripLight(SwitchBotCloudLight): @@ -145,6 +148,7 @@ class SwitchBotCloudStripLight(SwitchBotCloudLight): # RGB color control _attr_supported_color_modes = {ColorMode.RGB} + _attr_color_mode = ColorMode.RGB class SwitchBotCloudRGBICLight(SwitchBotCloudLight): @@ -154,6 +158,7 @@ class SwitchBotCloudRGBICLight(SwitchBotCloudLight): # RGB color control _attr_supported_color_modes = {ColorMode.RGB} + _attr_color_mode = ColorMode.RGB async def _send_rgb_color_command(self, rgb_color: tuple) -> None: """Send an RGB command.""" @@ -174,6 +179,7 @@ class SwitchBotCloudRGBWWLight(SwitchBotCloudLight): _attr_min_color_temp_kelvin = 2700 _attr_supported_color_modes = {ColorMode.RGB, ColorMode.COLOR_TEMP} + _attr_color_mode = ColorMode.RGB async def _send_brightness_command(self, brightness: int) -> None: """Send a brightness command.""" @@ -200,6 +206,7 @@ class SwitchBotCloudCeilingLight(SwitchBotCloudLight): _attr_min_color_temp_kelvin = 2700 _attr_supported_color_modes = {ColorMode.COLOR_TEMP} + _attr_color_mode = ColorMode.COLOR_TEMP async def _send_brightness_command(self, brightness: int) -> None: """Send a brightness command."""