From 1ecd88269d5483f13e66957f9a1ce72cd3e4e6c4 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 b790c88..f5b41e7 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" ) @@ -155,6 +159,7 @@ DISABLED_BY_DEFAULT: Final = [ CH3_HUMIDITY, CH4_TEMP, CH4_HUMIDITY, + OUTSIDE_BATTERY, ] @@ -178,6 +183,7 @@ class UnitOfDir(StrEnum): NNW = "nnw" N = "n" + AZIMUT: list[UnitOfDir] = [ UnitOfDir.NNE, UnitOfDir.NE, @@ -197,6 +203,7 @@ AZIMUT: list[UnitOfDir] = [ UnitOfDir.N, ] + class UnitOfBat(StrEnum): """Battery level unit of measure.""" @@ -204,6 +211,7 @@ class UnitOfBat(StrEnum): NORMAL = "normal" UNKNOWN = "unknown" + BATTERY_LEVEL: list[UnitOfBat] = [ UnitOfBat.LOW, UnitOfBat.NORMAL,