2021-12-23 18:34:35 +00:00
|
|
|
"""Constants for the Overkiz (by Somfy) integration."""
|
|
|
|
from __future__ import annotations
|
|
|
|
|
|
|
|
from datetime import timedelta
|
2022-01-13 01:23:20 +00:00
|
|
|
from typing import Final
|
2021-12-23 18:34:35 +00:00
|
|
|
|
|
|
|
from pyoverkiz.enums import UIClass
|
|
|
|
from pyoverkiz.enums.ui import UIWidget
|
|
|
|
|
|
|
|
from homeassistant.const import Platform
|
|
|
|
|
|
|
|
DOMAIN: Final = "overkiz"
|
|
|
|
|
|
|
|
CONF_HUB: Final = "hub"
|
|
|
|
DEFAULT_HUB: Final = "somfy_europe"
|
|
|
|
|
|
|
|
UPDATE_INTERVAL: Final = timedelta(seconds=30)
|
|
|
|
UPDATE_INTERVAL_ALL_ASSUMED_STATE: Final = timedelta(minutes=60)
|
|
|
|
|
|
|
|
PLATFORMS: list[Platform] = [
|
2021-12-28 09:10:39 +00:00
|
|
|
Platform.BINARY_SENSOR,
|
2021-12-24 00:21:47 +00:00
|
|
|
Platform.BUTTON,
|
2021-12-27 11:35:59 +00:00
|
|
|
Platform.LIGHT,
|
2021-12-23 23:28:01 +00:00
|
|
|
Platform.LOCK,
|
2021-12-24 20:29:51 +00:00
|
|
|
Platform.NUMBER,
|
2021-12-27 23:57:19 +00:00
|
|
|
Platform.SCENE,
|
2021-12-23 18:34:35 +00:00
|
|
|
Platform.SENSOR,
|
2022-01-17 18:21:37 +00:00
|
|
|
Platform.SWITCH,
|
2021-12-23 18:34:35 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
IGNORED_OVERKIZ_DEVICES: list[UIClass | UIWidget] = [
|
|
|
|
UIClass.PROTOCOL_GATEWAY,
|
|
|
|
UIClass.POD,
|
|
|
|
]
|
2021-12-23 23:28:01 +00:00
|
|
|
|
|
|
|
# Used to map the Somfy widget and ui_class to the Home Assistant platform
|
|
|
|
OVERKIZ_DEVICE_TO_PLATFORM: dict[UIClass | UIWidget, Platform] = {
|
|
|
|
UIClass.DOOR_LOCK: Platform.LOCK,
|
2022-01-17 18:21:37 +00:00
|
|
|
UIWidget.DOMESTIC_HOT_WATER_TANK: Platform.SWITCH, # widgetName, uiClass is WaterHeatingSystem (not supported)
|
2021-12-27 11:35:59 +00:00
|
|
|
UIClass.LIGHT: Platform.LIGHT,
|
2022-01-17 18:21:37 +00:00
|
|
|
UIClass.ON_OFF: Platform.SWITCH,
|
|
|
|
UIWidget.RTD_INDOOR_SIREN: Platform.SWITCH, # widgetName, uiClass is Siren (not supported)
|
|
|
|
UIWidget.RTD_OUTDOOR_SIREN: Platform.SWITCH, # widgetName, uiClass is Siren (not supported)
|
|
|
|
UIClass.SWIMMING_POOL: Platform.SWITCH,
|
2021-12-23 23:28:01 +00:00
|
|
|
}
|
2022-01-17 20:47:42 +00:00
|
|
|
|
|
|
|
# Map Overkiz camelCase to Home Assistant snake_case for translation
|
|
|
|
OVERKIZ_STATE_TO_TRANSLATION: dict[str, str] = {
|
|
|
|
"externalGateway": "external_gateway",
|
|
|
|
"localUser": "local_user",
|
|
|
|
"lowBattery": "low_battery",
|
|
|
|
"LSC": "lsc",
|
|
|
|
"maintenanceRequired": "maintenance_required",
|
|
|
|
"noDefect": "no_defect",
|
|
|
|
"SAAC": "saac",
|
|
|
|
"SFC": "sfc",
|
|
|
|
"UPS": "ups",
|
|
|
|
}
|