2021-04-25 10:10:33 +00:00
|
|
|
"""Constants for the FRITZ!Box Tools integration."""
|
|
|
|
|
2021-09-30 09:18:04 +00:00
|
|
|
from typing import Literal
|
|
|
|
|
2022-01-31 23:28:11 +00:00
|
|
|
from fritzconnection.core.exceptions import (
|
|
|
|
FritzActionError,
|
|
|
|
FritzActionFailedError,
|
2023-02-01 15:03:18 +00:00
|
|
|
FritzAuthorizationError,
|
|
|
|
FritzConnectionException,
|
2022-01-31 23:28:11 +00:00
|
|
|
FritzInternalError,
|
|
|
|
FritzLookUpError,
|
2023-02-01 15:03:18 +00:00
|
|
|
FritzSecurityError,
|
2022-01-31 23:28:11 +00:00
|
|
|
FritzServiceError,
|
|
|
|
)
|
|
|
|
|
2021-12-30 22:23:55 +00:00
|
|
|
from homeassistant.backports.enum import StrEnum
|
2021-12-04 12:26:40 +00:00
|
|
|
from homeassistant.const import Platform
|
|
|
|
|
2021-12-30 22:23:55 +00:00
|
|
|
|
|
|
|
class MeshRoles(StrEnum):
|
|
|
|
"""Available Mesh roles."""
|
|
|
|
|
|
|
|
NONE = "none"
|
|
|
|
MASTER = "master"
|
|
|
|
SLAVE = "slave"
|
|
|
|
|
|
|
|
|
2021-04-25 10:10:33 +00:00
|
|
|
DOMAIN = "fritz"
|
|
|
|
|
2021-12-04 12:26:40 +00:00
|
|
|
PLATFORMS = [
|
2021-12-16 12:25:06 +00:00
|
|
|
Platform.BUTTON,
|
2021-12-04 12:26:40 +00:00
|
|
|
Platform.BINARY_SENSOR,
|
|
|
|
Platform.DEVICE_TRACKER,
|
|
|
|
Platform.SENSOR,
|
|
|
|
Platform.SWITCH,
|
2022-04-19 15:12:21 +00:00
|
|
|
Platform.UPDATE,
|
2021-12-04 12:26:40 +00:00
|
|
|
]
|
2021-04-25 10:10:33 +00:00
|
|
|
|
2022-02-23 00:35:48 +00:00
|
|
|
CONF_OLD_DISCOVERY = "old_discovery"
|
|
|
|
DEFAULT_CONF_OLD_DISCOVERY = False
|
|
|
|
|
2021-04-29 18:10:36 +00:00
|
|
|
DATA_FRITZ = "fritz_data"
|
2021-04-25 10:10:33 +00:00
|
|
|
|
2021-09-30 09:18:04 +00:00
|
|
|
DSL_CONNECTION: Literal["dsl"] = "dsl"
|
2021-08-08 09:23:28 +00:00
|
|
|
|
2021-04-25 10:10:33 +00:00
|
|
|
DEFAULT_DEVICE_NAME = "Unknown device"
|
|
|
|
DEFAULT_HOST = "192.168.178.1"
|
|
|
|
DEFAULT_PORT = 49000
|
|
|
|
DEFAULT_USERNAME = ""
|
|
|
|
|
|
|
|
ERROR_AUTH_INVALID = "invalid_auth"
|
2021-05-14 16:46:37 +00:00
|
|
|
ERROR_CANNOT_CONNECT = "cannot_connect"
|
2022-03-03 23:41:50 +00:00
|
|
|
ERROR_UPNP_NOT_CONFIGURED = "upnp_not_configured"
|
2021-04-25 10:10:33 +00:00
|
|
|
ERROR_UNKNOWN = "unknown_error"
|
|
|
|
|
2021-05-11 20:56:52 +00:00
|
|
|
FRITZ_SERVICES = "fritz_services"
|
|
|
|
SERVICE_REBOOT = "reboot"
|
|
|
|
SERVICE_RECONNECT = "reconnect"
|
2021-10-27 10:01:06 +00:00
|
|
|
SERVICE_CLEANUP = "cleanup"
|
2022-02-04 07:57:14 +00:00
|
|
|
SERVICE_SET_GUEST_WIFI_PW = "set_guest_wifi_password"
|
2021-05-11 20:56:52 +00:00
|
|
|
|
2021-06-29 15:57:34 +00:00
|
|
|
SWITCH_TYPE_DEFLECTION = "CallDeflection"
|
|
|
|
SWITCH_TYPE_PORTFORWARD = "PortForward"
|
2022-03-04 14:49:22 +00:00
|
|
|
SWITCH_TYPE_PROFILE = "Profile"
|
2021-06-29 15:57:34 +00:00
|
|
|
SWITCH_TYPE_WIFINETWORK = "WiFiNetwork"
|
|
|
|
|
2021-05-07 14:05:16 +00:00
|
|
|
UPTIME_DEVIATION = 5
|
2022-01-31 23:28:11 +00:00
|
|
|
|
|
|
|
FRITZ_EXCEPTIONS = (
|
|
|
|
FritzActionError,
|
|
|
|
FritzActionFailedError,
|
2023-02-01 15:03:18 +00:00
|
|
|
FritzConnectionException,
|
2022-01-31 23:28:11 +00:00
|
|
|
FritzInternalError,
|
|
|
|
FritzServiceError,
|
|
|
|
FritzLookUpError,
|
|
|
|
)
|
2022-02-18 08:13:36 +00:00
|
|
|
|
2023-02-01 15:03:18 +00:00
|
|
|
FRITZ_AUTH_EXCEPTIONS = (FritzAuthorizationError, FritzSecurityError)
|
|
|
|
|
2022-02-18 08:13:36 +00:00
|
|
|
WIFI_STANDARD = {1: "2.4Ghz", 2: "5Ghz", 3: "5Ghz", 4: "Guest"}
|