2021-07-16 16:46:23 +00:00
|
|
|
"""Constants for Plugwise component."""
|
2022-05-12 13:19:50 +00:00
|
|
|
from __future__ import annotations
|
|
|
|
|
2022-02-05 15:46:50 +00:00
|
|
|
from datetime import timedelta
|
2022-02-05 23:43:05 +00:00
|
|
|
import logging
|
2022-05-12 13:19:50 +00:00
|
|
|
from typing import Final
|
2022-02-05 15:46:50 +00:00
|
|
|
|
2021-12-04 12:19:49 +00:00
|
|
|
from homeassistant.const import Platform
|
2021-07-16 16:46:23 +00:00
|
|
|
|
2022-05-12 13:19:50 +00:00
|
|
|
DOMAIN: Final = "plugwise"
|
2022-02-05 23:43:05 +00:00
|
|
|
|
|
|
|
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,
|
2022-03-21 20:13:03 +00:00
|
|
|
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]] = {
|
2021-07-16 16:46:23 +00:00
|
|
|
"smile": "P1",
|
|
|
|
"smile_thermo": "Anna",
|
|
|
|
"smile_open_therm": "Adam",
|
|
|
|
"stretch": "Stretch",
|
|
|
|
}
|
2020-10-07 20:25:42 +00:00
|
|
|
|
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]] = {
|
2022-02-05 15:46:50 +00:00
|
|
|
"power": timedelta(seconds=10),
|
|
|
|
"stretch": timedelta(seconds=60),
|
|
|
|
"thermostat": timedelta(seconds=60),
|
2021-07-16 16:46:23 +00:00
|
|
|
}
|
2022-05-12 13:19:50 +00:00
|
|
|
DEFAULT_USERNAME: Final = "smile"
|
2022-03-21 20:13:03 +00:00
|
|
|
|
2022-05-12 13:19:50 +00:00
|
|
|
THERMOSTAT_CLASSES: Final[list[str]] = [
|
2022-03-21 20:13:03 +00:00
|
|
|
"thermostat",
|
|
|
|
"thermostatic_radiator_valve",
|
|
|
|
"zone_thermometer",
|
|
|
|
"zone_thermostat",
|
|
|
|
]
|