diff --git a/ecowitt2mqtt/__main__.py b/ecowitt2mqtt/__main__.py index f66d0b22..2e9ebbfa 100644 --- a/ecowitt2mqtt/__main__.py +++ b/ecowitt2mqtt/__main__.py @@ -251,7 +251,7 @@ def get_cli_arguments(args: list[str]) -> dict[str, Any]: parser.add_argument( "--locale", dest=CONF_LOCALE, - help=f"The locale to set (default: system default)", + help="The locale to set (default: system default)", metavar=CONF_LOCALE, ) parser.add_argument( diff --git a/ecowitt2mqtt/core.py b/ecowitt2mqtt/core.py index 97121545..d58cc1fb 100644 --- a/ecowitt2mqtt/core.py +++ b/ecowitt2mqtt/core.py @@ -63,9 +63,9 @@ def __init__(self, params: dict[str, Any]) -> None: LOGGER.debug("Input CLI options/environment variables: %s", params) LOGGER.debug("Configs loaded: %s", self.configs) - if locale := self.configs.default_config.locale: + if provided_locale := self.configs.default_config.locale: LOGGER.debug("Setting locale: %s", self.configs.default_config.locale) - locale.setlocale(locale.LC_ALL, locale) + locale.setlocale(locale.LC_ALL, provided_locale) self.runtime = Runtime(self)