From de013891c0440d2742716ddc8ae131c796a69ec6 Mon Sep 17 00:00:00 2001 From: schizza Date: Mon, 18 Aug 2025 12:53:40 +0200 Subject: [PATCH] Adds missing constant and improves readability Adds OUTSIDE_BATTERY to the DISABLED_BY_DEFAULT list. Improves readability by formatting long strings with parenthesis. --- custom_components/sws12500/const.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/custom_components/sws12500/const.py b/custom_components/sws12500/const.py index 42a5af8..f0faff9 100644 --- a/custom_components/sws12500/const.py +++ b/custom_components/sws12500/const.py @@ -23,8 +23,12 @@ WSLINK: Final = "wslink" WINDY_API_KEY = "WINDY_API_KEY" WINDY_ENABLED: Final = "windy_enabled_checkbox" WINDY_LOGGER_ENABLED: Final = "windy_logger_checkbox" -WINDY_NOT_INSERTED: Final = "Data was succefuly sent to Windy, but not inserted by Windy API. Does anyone else sent data to Windy?" -WINDY_INVALID_KEY: Final = "Windy API KEY is invalid. Send data to Windy is now disabled. Check your API KEY and try again." +WINDY_NOT_INSERTED: Final = ( + "Data was succefuly sent to Windy, but not inserted by Windy API. Does anyone else sent data to Windy?" +) +WINDY_INVALID_KEY: Final = ( + "Windy API KEY is invalid. Send data to Windy is now disabled. Check your API KEY and try again." +) WINDY_SUCCESS: Final = ( "Windy successfully sent data and data was successfully inserted by Windy API" ) @@ -156,6 +160,7 @@ DISABLED_BY_DEFAULT: Final = [ CH3_HUMIDITY, CH4_TEMP, CH4_HUMIDITY, + OUTSIDE_BATTERY, ] @@ -179,6 +184,7 @@ class UnitOfDir(StrEnum): NNW = "nnw" N = "n" + AZIMUT: list[UnitOfDir] = [ UnitOfDir.NNE, UnitOfDir.NE, @@ -198,6 +204,7 @@ AZIMUT: list[UnitOfDir] = [ UnitOfDir.N, ] + class UnitOfBat(StrEnum): """Battery level unit of measure.""" @@ -205,6 +212,7 @@ class UnitOfBat(StrEnum): NORMAL = "normal" UNKNOWN = "unknown" + BATTERY_LEVEL: list[UnitOfBat] = [ UnitOfBat.LOW, UnitOfBat.NORMAL,