From 11916d6b18a48b2e17336a6fae722256d174be4d Mon Sep 17 00:00:00 2001 From: Robert Svensson Date: Thu, 14 Mar 2024 20:34:15 +0100 Subject: [PATCH] Add enum for web protocol --- axis/configuration.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/axis/configuration.py b/axis/configuration.py index ffee0d81..1f84f31a 100644 --- a/axis/configuration.py +++ b/axis/configuration.py @@ -1,10 +1,18 @@ """Python library to enable Axis devices to integrate with Home Assistant.""" from dataclasses import KW_ONLY, dataclass +import enum from httpx import AsyncClient +class WebProtocol(enum.StrEnum): + """Web protocol for Axis configuration.""" + + HTTP = "http" + HTTPS = "https" + + @dataclass class Configuration: """Device configuration.""" @@ -15,7 +23,7 @@ class Configuration: username: str password: str port: int = 80 - web_proto: str = "http" + web_proto: str = WebProtocol.HTTP verify_ssl: bool = False @property