2021-09-18 19:25:05 +00:00
|
|
|
"""Constants for the switchbot integration."""
|
2022-08-10 19:02:08 +00:00
|
|
|
from switchbot import SwitchbotModel
|
|
|
|
|
|
|
|
from homeassistant.backports.enum import StrEnum
|
|
|
|
|
2021-09-18 19:25:05 +00:00
|
|
|
DOMAIN = "switchbot"
|
|
|
|
MANUFACTURER = "switchbot"
|
|
|
|
|
|
|
|
# Config Attributes
|
2022-08-10 19:02:08 +00:00
|
|
|
|
2021-09-18 19:25:05 +00:00
|
|
|
DEFAULT_NAME = "Switchbot"
|
2022-08-02 10:38:31 +00:00
|
|
|
|
2022-08-10 19:02:08 +00:00
|
|
|
|
|
|
|
class SupportedModels(StrEnum):
|
|
|
|
"""Supported Switchbot models."""
|
|
|
|
|
|
|
|
BOT = "bot"
|
|
|
|
BULB = "bulb"
|
|
|
|
CURTAIN = "curtain"
|
|
|
|
HYGROMETER = "hygrometer"
|
|
|
|
CONTACT = "contact"
|
|
|
|
PLUG = "plug"
|
|
|
|
MOTION = "motion"
|
|
|
|
|
|
|
|
|
2022-08-22 18:02:26 +00:00
|
|
|
CONNECTABLE_SUPPORTED_MODEL_TYPES = {
|
2022-08-10 19:02:08 +00:00
|
|
|
SwitchbotModel.BOT: SupportedModels.BOT,
|
|
|
|
SwitchbotModel.CURTAIN: SupportedModels.CURTAIN,
|
2022-08-22 18:02:26 +00:00
|
|
|
SwitchbotModel.PLUG_MINI: SupportedModels.PLUG,
|
|
|
|
SwitchbotModel.COLOR_BULB: SupportedModels.BULB,
|
|
|
|
}
|
|
|
|
|
|
|
|
NON_CONNECTABLE_SUPPORTED_MODEL_TYPES = {
|
2022-08-10 19:02:08 +00:00
|
|
|
SwitchbotModel.METER: SupportedModels.HYGROMETER,
|
|
|
|
SwitchbotModel.CONTACT_SENSOR: SupportedModels.CONTACT,
|
|
|
|
SwitchbotModel.MOTION_SENSOR: SupportedModels.MOTION,
|
2022-07-22 16:03:02 +00:00
|
|
|
}
|
2021-09-18 19:25:05 +00:00
|
|
|
|
2022-08-22 18:02:26 +00:00
|
|
|
SUPPORTED_MODEL_TYPES = {
|
|
|
|
**CONNECTABLE_SUPPORTED_MODEL_TYPES,
|
|
|
|
**NON_CONNECTABLE_SUPPORTED_MODEL_TYPES,
|
|
|
|
}
|
2022-08-10 19:02:08 +00:00
|
|
|
|
2021-09-18 19:25:05 +00:00
|
|
|
# Config Defaults
|
|
|
|
DEFAULT_RETRY_COUNT = 3
|
|
|
|
|
|
|
|
# Config Options
|
|
|
|
CONF_RETRY_COUNT = "retry_count"
|
|
|
|
|
2022-07-24 16:38:45 +00:00
|
|
|
# Deprecated config Entry Options to be removed in 2023.4
|
|
|
|
CONF_TIME_BETWEEN_UPDATE_COMMAND = "update_time"
|
|
|
|
CONF_RETRY_TIMEOUT = "retry_timeout"
|
2022-07-24 21:38:07 +00:00
|
|
|
CONF_SCAN_TIMEOUT = "scan_timeout"
|