From 45f124723785ca0ecd4b696a91e7ac371ea14459 Mon Sep 17 00:00:00 2001 From: Samuel Xiao <40679757+XiaoLing-git@users.noreply.github.com> Date: Tue, 17 Mar 2026 16:59:18 +0800 Subject: [PATCH] Switchbot Cloud: Add new supported device(Standing Fan) (#165755) --- homeassistant/components/switchbot_cloud/__init__.py | 5 ++++- homeassistant/components/switchbot_cloud/sensor.py | 1 + tests/components/switchbot_cloud/__init__.py | 8 ++++++++ tests/components/switchbot_cloud/test_fan.py | 4 ++++ 4 files changed, 17 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/switchbot_cloud/__init__.py b/homeassistant/components/switchbot_cloud/__init__.py index 07d68ed11fc..aa32576e8a2 100644 --- a/homeassistant/components/switchbot_cloud/__init__.py +++ b/homeassistant/components/switchbot_cloud/__init__.py @@ -245,7 +245,10 @@ async def make_device_data( devices_data.binary_sensors.append((device, coordinator)) devices_data.sensors.append((device, coordinator)) - if isinstance(device, Device) and device.device_type == "Battery Circulator Fan": + if isinstance(device, Device) and device.device_type in [ + "Battery Circulator Fan", + "Standing Fan", + ]: coordinator = await coordinator_for_device( hass, entry, api, device, coordinators_by_id ) diff --git a/homeassistant/components/switchbot_cloud/sensor.py b/homeassistant/components/switchbot_cloud/sensor.py index 2bd6efa7daa..1b74756bbae 100644 --- a/homeassistant/components/switchbot_cloud/sensor.py +++ b/homeassistant/components/switchbot_cloud/sensor.py @@ -169,6 +169,7 @@ LIGHTLEVEL_DESCRIPTION = SwitchbotCloudSensorEntityDescription( SENSOR_DESCRIPTIONS_BY_DEVICE_TYPES = { "Bot": (BATTERY_DESCRIPTION,), "Battery Circulator Fan": (BATTERY_DESCRIPTION,), + "Standing Fan": (BATTERY_DESCRIPTION,), "Meter": ( TEMPERATURE_DESCRIPTION, HUMIDITY_DESCRIPTION, diff --git a/tests/components/switchbot_cloud/__init__.py b/tests/components/switchbot_cloud/__init__.py index afc03e829d7..6ad74cf9cb4 100644 --- a/tests/components/switchbot_cloud/__init__.py +++ b/tests/components/switchbot_cloud/__init__.py @@ -49,6 +49,14 @@ CIRCULATOR_FAN_INFO = Device( hubDeviceId="test-hub-id", ) +STANDING_FAN_INFO = Device( + version="V1.0", + deviceId="standing-fan-id-1", + deviceName="standing-fan-1", + deviceType="Standing Fan", + hubDeviceId="test-hub-id", +) + METER_INFO = Device( version="V1.0", diff --git a/tests/components/switchbot_cloud/test_fan.py b/tests/components/switchbot_cloud/test_fan.py index f1c667b8c0f..9f2cd586d1b 100644 --- a/tests/components/switchbot_cloud/test_fan.py +++ b/tests/components/switchbot_cloud/test_fan.py @@ -32,6 +32,7 @@ from . import ( AIR_PURIFIER_INFO, BATTERY_CIRCULATOR_FAN_INFO, CIRCULATOR_FAN_INFO, + STANDING_FAN_INFO, configure_integration, ) @@ -69,6 +70,7 @@ async def test_coordinator_data_is_none( [ (CIRCULATOR_FAN_INFO, "fan.fan_1"), (BATTERY_CIRCULATOR_FAN_INFO, "fan.battery_fan_1"), + (STANDING_FAN_INFO, "fan.standing_fan_1"), ], ) async def test_turn_on( @@ -153,6 +155,7 @@ async def test_turn_off( [ (CIRCULATOR_FAN_INFO, "fan.fan_1"), (BATTERY_CIRCULATOR_FAN_INFO, "fan.battery_fan_1"), + (STANDING_FAN_INFO, "fan.standing_fan_1"), ], ) async def test_set_percentage( @@ -195,6 +198,7 @@ async def test_set_percentage( [ (CIRCULATOR_FAN_INFO, "fan.fan_1"), (BATTERY_CIRCULATOR_FAN_INFO, "fan.battery_fan_1"), + (STANDING_FAN_INFO, "fan.standing_fan_1"), ], ) async def test_set_preset_mode(