From e5f2613108198d350c2f2f9965beb0d489e96322 Mon Sep 17 00:00:00 2001 From: Stephen Jefferson Date: Fri, 26 Apr 2024 18:10:39 +0100 Subject: [PATCH] Incorrect default wind direction value --- enviro/config_defaults.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/enviro/config_defaults.py b/enviro/config_defaults.py index f09cc87..edde40b 100644 --- a/enviro/config_defaults.py +++ b/enviro/config_defaults.py @@ -2,7 +2,7 @@ from phew import logging DEFAULT_USB_POWER_TEMPERATURE_OFFSET = 4.5 - +DEFAULT_WIND_DIRECTION_OFFSET = 0 def add_missing_config_settings(): try: @@ -17,18 +17,18 @@ def add_missing_config_settings(): except AttributeError: warn_missing_config_setting("usb_power_temperature_offset") config.usb_power_temperature_offset = DEFAULT_USB_POWER_TEMPERATURE_OFFSET - - try: - config.wind_direction_offset - except AttributeError: - warn_missing_config_setting("wind_direction_offset") - config.wind_direction_offset = DEFAULT_USB_POWER_TEMPERATURE_OFFSET - + try: config.wifi_country except AttributeError: warn_missing_config_setting("wifi_country") config.wifi_country = "GB" + try: + config.wind_direction_offset + except AttributeError: + warn_missing_config_setting("wind_direction_offset") + config.wind_direction_offset = DEFAULT_WIND_DIRECTION_OFFSET + def warn_missing_config_setting(setting): logging.warn(f"> config setting '{setting}' missing, please add it to config.py")