mirror of
https://github.com/home-assistant/core.git
synced 2026-04-02 08:26:41 +01:00
Switchbot Cloud: Add new supported device(Standing Fan) (#165755)
This commit is contained in:
@@ -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
|
||||
)
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user