Co-authored-by: Teemu Rytilahti <tpr@iki.fi> Co-authored-by: sdb9696 <steven.beth@gmail.com> Co-authored-by: Steven B <51370195+sdb9696@users.noreply.github.com> Co-authored-by: J. Nick Koston <nick@koston.org> Co-authored-by: Teemu R. <tpr@iki.fi>
40 lines
895 B
Python
40 lines
895 B
Python
"""Const for TP-Link."""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import Final
|
|
|
|
from homeassistant.const import Platform, UnitOfTemperature
|
|
|
|
DOMAIN = "tplink"
|
|
|
|
DISCOVERY_TIMEOUT = 5 # Home Assistant will complain if startup takes > 10s
|
|
CONNECT_TIMEOUT = 5
|
|
|
|
# Identifier used for primary control state.
|
|
PRIMARY_STATE_ID = "state"
|
|
|
|
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"
|
|
|
|
CONF_DEVICE_CONFIG: Final = "device_config"
|
|
|
|
PLATFORMS: Final = [
|
|
Platform.BINARY_SENSOR,
|
|
Platform.BUTTON,
|
|
Platform.CLIMATE,
|
|
Platform.FAN,
|
|
Platform.LIGHT,
|
|
Platform.NUMBER,
|
|
Platform.SELECT,
|
|
Platform.SENSOR,
|
|
Platform.SWITCH,
|
|
]
|
|
|
|
UNIT_MAPPING = {
|
|
"celsius": UnitOfTemperature.CELSIUS,
|
|
"fahrenheit": UnitOfTemperature.FAHRENHEIT,
|
|
}
|