2019-05-13 08:16:55 +00:00
|
|
|
"""Const for TP-Link."""
|
2024-03-08 15:35:23 +00:00
|
|
|
|
2021-07-29 18:02:47 +00:00
|
|
|
from __future__ import annotations
|
|
|
|
|
2021-09-27 19:11:55 +00:00
|
|
|
from typing import Final
|
2019-05-13 08:16:55 +00:00
|
|
|
|
2024-06-25 20:01:21 +00:00
|
|
|
from homeassistant.const import Platform, UnitOfTemperature
|
2021-12-04 13:10:01 +00:00
|
|
|
|
2019-05-13 08:16:55 +00:00
|
|
|
DOMAIN = "tplink"
|
2021-07-29 18:02:47 +00:00
|
|
|
|
2024-01-21 15:25:12 +00:00
|
|
|
DISCOVERY_TIMEOUT = 5 # Home Assistant will complain if startup takes > 10s
|
|
|
|
CONNECT_TIMEOUT = 5
|
|
|
|
|
2024-06-25 20:01:21 +00:00
|
|
|
# Identifier used for primary control state.
|
|
|
|
PRIMARY_STATE_ID = "state"
|
|
|
|
|
2021-09-27 19:11:55 +00:00
|
|
|
ATTR_CURRENT_A: Final = "current_a"
|
|
|
|
ATTR_CURRENT_POWER_W: Final = "current_power_w"
|
|
|
|
ATTR_TODAY_ENERGY_KWH: Final = "today_energy_kwh"
|
|
|
|
ATTR_TOTAL_ENERGY_KWH: Final = "total_energy_kwh"
|
2021-07-29 18:02:47 +00:00
|
|
|
|
2024-01-21 15:25:12 +00:00
|
|
|
CONF_DEVICE_CONFIG: Final = "device_config"
|
2024-06-27 12:34:12 +00:00
|
|
|
CONF_CREDENTIALS_HASH: Final = "credentials_hash"
|
2024-09-10 18:52:10 +00:00
|
|
|
CONF_CONNECTION_PARAMETERS: Final = "connection_parameters"
|
|
|
|
CONF_USES_HTTP: Final = "uses_http"
|
|
|
|
CONF_AES_KEYS: Final = "aes_keys"
|
|
|
|
|
|
|
|
CONF_CONFIG_ENTRY_MINOR_VERSION: Final = 5
|
2021-07-29 18:02:47 +00:00
|
|
|
|
2024-06-25 20:01:21 +00:00
|
|
|
PLATFORMS: Final = [
|
|
|
|
Platform.BINARY_SENSOR,
|
|
|
|
Platform.BUTTON,
|
|
|
|
Platform.CLIMATE,
|
|
|
|
Platform.FAN,
|
|
|
|
Platform.LIGHT,
|
|
|
|
Platform.NUMBER,
|
|
|
|
Platform.SELECT,
|
|
|
|
Platform.SENSOR,
|
2024-09-20 14:11:02 +00:00
|
|
|
Platform.SIREN,
|
2024-06-25 20:01:21 +00:00
|
|
|
Platform.SWITCH,
|
|
|
|
]
|
|
|
|
|
|
|
|
UNIT_MAPPING = {
|
|
|
|
"celsius": UnitOfTemperature.CELSIUS,
|
|
|
|
"fahrenheit": UnitOfTemperature.FAHRENHEIT,
|
|
|
|
}
|