diff --git a/homeassistant/components/switchbot/__init__.py b/homeassistant/components/switchbot/__init__.py index e32252a7615..7eec785233f 100644 --- a/homeassistant/components/switchbot/__init__.py +++ b/homeassistant/components/switchbot/__init__.py @@ -22,6 +22,7 @@ from .const import ( ATTR_CONTACT, ATTR_CURTAIN, ATTR_HYGROMETER, + ATTR_MOTION, ATTR_PLUG, CONF_RETRY_COUNT, DEFAULT_RETRY_COUNT, @@ -35,6 +36,7 @@ PLATFORMS_BY_TYPE = { ATTR_CURTAIN: [Platform.COVER, Platform.BINARY_SENSOR, Platform.SENSOR], ATTR_HYGROMETER: [Platform.SENSOR], ATTR_CONTACT: [Platform.BINARY_SENSOR, Platform.SENSOR], + ATTR_MOTION: [Platform.BINARY_SENSOR, Platform.SENSOR], } CLASS_BY_DEVICE = { ATTR_CURTAIN: switchbot.SwitchbotCurtain, diff --git a/homeassistant/components/switchbot/const.py b/homeassistant/components/switchbot/const.py index 9cc2acebbf8..a8ec3433f84 100644 --- a/homeassistant/components/switchbot/const.py +++ b/homeassistant/components/switchbot/const.py @@ -8,13 +8,16 @@ ATTR_CURTAIN = "curtain" ATTR_HYGROMETER = "hygrometer" ATTR_CONTACT = "contact" ATTR_PLUG = "plug" +ATTR_MOTION = "motion" DEFAULT_NAME = "Switchbot" + SUPPORTED_MODEL_TYPES = { "WoHand": ATTR_BOT, "WoCurtain": ATTR_CURTAIN, "WoSensorTH": ATTR_HYGROMETER, "WoContact": ATTR_CONTACT, "WoPlug": ATTR_PLUG, + "WoPresence": ATTR_MOTION, } # Config Defaults