core/homeassistant/components/plugwise/const.py

57 lines
1.3 KiB
Python
Raw Normal View History

"""Constants for Plugwise component."""
2022-05-12 13:19:50 +00:00
from __future__ import annotations
from datetime import timedelta
import logging
2022-05-12 13:19:50 +00:00
from typing import Final
2021-12-04 12:19:49 +00:00
from homeassistant.const import Platform
2022-05-12 13:19:50 +00:00
DOMAIN: Final = "plugwise"
LOGGER = logging.getLogger(__package__)
2022-05-12 13:19:50 +00:00
API: Final = "api"
FLOW_SMILE: Final = "smile (Adam/Anna/P1)"
FLOW_STRETCH: Final = "stretch (Stretch)"
FLOW_TYPE: Final = "flow_type"
GATEWAY: Final = "gateway"
PW_TYPE: Final = "plugwise_type"
SMILE: Final = "smile"
STRETCH: Final = "stretch"
STRETCH_USERNAME: Final = "stretch"
UNIT_LUMEN: Final = "lm"
PLATFORMS_GATEWAY: Final[list[str]] = [
2021-12-04 12:19:49 +00:00
Platform.BINARY_SENSOR,
Platform.CLIMATE,
2022-07-13 07:21:58 +00:00
Platform.NUMBER,
Platform.SELECT,
2022-07-13 07:21:58 +00:00
Platform.SENSOR,
2022-05-12 13:19:50 +00:00
Platform.SWITCH,
2021-12-04 12:19:49 +00:00
]
2022-05-12 13:19:50 +00:00
ZEROCONF_MAP: Final[dict[str, str]] = {
"smile": "P1",
"smile_thermo": "Anna",
"smile_open_therm": "Adam",
"stretch": "Stretch",
}
Update plugwise to async and config_flow (#33691) * Update plugwise async, config_flow and multi entity * Update battery percentage * Fix yamllint on services * Fix yamllint on services * Fix formatting for pyupgrade * Update homeassistant/components/plugwise/__init__.py Co-Authored-By: Robert Svensson <Kane610@users.noreply.github.com> * Add try/except on setup * Bump module version, battery version and valve position * Removing sensor, switch, water_heater for later (child) PRs * Catchup and version bump * Remove title from strings.json * Readd already reviewd await try/except * Readd already reviewed config_flow * Fix pylint * Fix per 0.109 translations * Remove unused import from merge * Update plugwise async, config_flow and multi entity * Update battery percentage * Fix yamllint on services * Fix yamllint on services * Bump module version * Bump module version, battery version and valve position * Removing sensor, switch, water_heater for later (child) PRs * Catchup and version bump * Remove title from strings.json * Fix pylint * Fix per 0.109 translations * Translations and config_flow, module version bump with required changes * Translations and config_flow, module version bump with required changes * Fix requirements * Fix requirements * Fix pylint * Fix pylint * Update homeassistant/components/plugwise/__init__.py Improvement Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/plugwise/__init__.py Improvement Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/plugwise/__init__.py Improvement Co-authored-by: J. Nick Koston <nick@koston.org> * Include configentrynotready on import * Update __init__.py * DataUpdateCoordinator and comment non-PR-platforms * Fix reqs * Rename devices variable in favor of entities * Rework updates with DataUpdateCoordinator * Peer review * Peer review second part * Cleanup comments and redundant code * Added required config_flow test * Peer review third part * Update service was replaced by DataUpdateCoordinator * Corrected testing, version bump for InvalidAuth, move uniq_id * Remove according to review * Await connect (py38) * Remove unneccesary code * Show only when multiple * Improve config_flow, rename consts * Update homeassistant/components/plugwise/climate.py Co-authored-by: J. Nick Koston <nick@koston.org> * Update homeassistant/components/plugwise/climate.py Co-authored-by: J. Nick Koston <nick@koston.org> * Process review comments Co-authored-by: Robert Svensson <Kane610@users.noreply.github.com> Co-authored-by: J. Nick Koston <nick@koston.org>
2020-05-28 15:52:25 +00:00
# Default directives
2022-05-12 13:19:50 +00:00
DEFAULT_MAX_TEMP: Final = 30
DEFAULT_MIN_TEMP: Final = 4
DEFAULT_PORT: Final = 80
DEFAULT_SCAN_INTERVAL: Final[dict[str, timedelta]] = {
"power": timedelta(seconds=10),
"stretch": timedelta(seconds=60),
"thermostat": timedelta(seconds=60),
}
2022-05-12 13:19:50 +00:00
DEFAULT_USERNAME: Final = "smile"
2022-05-12 13:19:50 +00:00
THERMOSTAT_CLASSES: Final[list[str]] = [
"thermostat",
"thermostatic_radiator_valve",
"zone_thermometer",
"zone_thermostat",
]