Timo S d6693cdff9
Add fritz set guest wifi password service (#62892)
* Add a new service set_guest_wifi_password to the fritz integration.

* Remove unnecessary params defaults

* Remove default password length

* Add service schema, cleanup code

* Fix min password length in services.yaml

* Move schema to `services.py`, add typing

* Add default password length from upstream lib

* Remove None typing

Co-authored-by: Michael <35783820+mib1185@users.noreply.github.com>

Co-authored-by: Michael <35783820+mib1185@users.noreply.github.com>
2022-02-04 08:57:14 +01:00

67 lines
1.3 KiB
Python

"""Constants for the FRITZ!Box Tools integration."""
from typing import Literal
from fritzconnection.core.exceptions import (
FritzActionError,
FritzActionFailedError,
FritzInternalError,
FritzLookUpError,
FritzServiceError,
)
from homeassistant.backports.enum import StrEnum
from homeassistant.const import Platform
class MeshRoles(StrEnum):
"""Available Mesh roles."""
NONE = "none"
MASTER = "master"
SLAVE = "slave"
DOMAIN = "fritz"
PLATFORMS = [
Platform.BUTTON,
Platform.BINARY_SENSOR,
Platform.DEVICE_TRACKER,
Platform.SENSOR,
Platform.SWITCH,
]
DATA_FRITZ = "fritz_data"
DSL_CONNECTION: Literal["dsl"] = "dsl"
DEFAULT_DEVICE_NAME = "Unknown device"
DEFAULT_HOST = "192.168.178.1"
DEFAULT_PORT = 49000
DEFAULT_USERNAME = ""
ERROR_AUTH_INVALID = "invalid_auth"
ERROR_CANNOT_CONNECT = "cannot_connect"
ERROR_UNKNOWN = "unknown_error"
FRITZ_SERVICES = "fritz_services"
SERVICE_REBOOT = "reboot"
SERVICE_RECONNECT = "reconnect"
SERVICE_CLEANUP = "cleanup"
SERVICE_SET_GUEST_WIFI_PW = "set_guest_wifi_password"
SWITCH_TYPE_DEFLECTION = "CallDeflection"
SWITCH_TYPE_PORTFORWARD = "PortForward"
SWITCH_TYPE_WIFINETWORK = "WiFiNetwork"
UPTIME_DEVIATION = 5
FRITZ_EXCEPTIONS = (
FritzActionError,
FritzActionFailedError,
FritzInternalError,
FritzServiceError,
FritzLookUpError,
)