1
0
mirror of https://github.com/home-assistant/core.git synced 2026-06-02 21:54:27 +01:00

Add Presence Sensor support to Switchbot Cloud (#155309)

This commit is contained in:
Samuel Xiao
2025-10-28 14:33:21 +08:00
committed by GitHub
parent 1a5f431485
commit f7e5dc7637
3 changed files with 4 additions and 0 deletions
@@ -205,6 +205,7 @@ async def make_device_data(
if isinstance(device, Device) and device.device_type in [
"Motion Sensor",
"Contact Sensor",
"Presence Sensor",
]:
coordinator = await coordinator_for_device(
hass, entry, api, device, coordinators_by_id, True
@@ -52,6 +52,7 @@ MOVE_DETECTED_DESCRIPTION = SwitchBotCloudBinarySensorEntityDescription(
value_fn=(
lambda data: data.get("moveDetected") is True
or data.get("detectionState") == "DETECTED"
or data.get("detected") is True
),
)
@@ -108,6 +109,7 @@ BINARY_SENSOR_DESCRIPTIONS_BY_DEVICE_TYPES = {
IS_LIGHT_DESCRIPTION,
MOVE_DETECTED_DESCRIPTION,
),
"Presence Sensor": (MOVE_DETECTED_DESCRIPTION,),
}
@@ -180,6 +180,7 @@ SENSOR_DESCRIPTIONS_BY_DEVICE_TYPES = {
HUMIDITY_DESCRIPTION,
BATTERY_DESCRIPTION,
),
"Presence Sensor": (BATTERY_DESCRIPTION,),
"Relay Switch 1PM": (
POWER_DESCRIPTION,
VOLTAGE_DESCRIPTION,