From 5f435366127ff6a0dd30fbc21db46a9d62931e15 Mon Sep 17 00:00:00 2001 From: Eric Callahan Date: Tue, 27 Jun 2023 11:59:37 -0400 Subject: [PATCH] update_manager: update base channel config Allow independent channel configuration for Moonraker and Klipper. Signed-off-by: Eric Callahan --- moonraker/components/update_manager/base_config.py | 13 +++++++++---- .../components/update_manager/update_manager.py | 7 ++++--- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/moonraker/components/update_manager/base_config.py b/moonraker/components/update_manager/base_config.py index 22f750a..53f9340 100644 --- a/moonraker/components/update_manager/base_config.py +++ b/moonraker/components/update_manager/base_config.py @@ -67,8 +67,13 @@ def get_base_configuration(config: ConfigHelper) -> ConfigHelper: "moonraker", "update_manager.klipper_exec", KLIPPER_DEFAULT_EXEC ).result() base_cfg["klipper"]["type"] = get_app_type(base_cfg["klipper"]["path"]) - if config.has_option("channel"): - channel = config.get("channel") - base_cfg["moonraker"]["channel"] = channel - base_cfg["klipper"]["channel"] = channel + channel = config.get("channel", "dev") + base_cfg["moonraker"]["channel"] = channel + base_cfg["klipper"]["channel"] = channel + if config.has_section("update_manager moonraker"): + mcfg = config["update_manager moonraker"] + base_cfg["moonraker"]["channel"] = mcfg.get("channel", channel) + if config.has_section("update_manager klipper"): + kcfg = config["update_manager klipper"] + base_cfg["klipper"]["channel"] = kcfg.get("channel", channel) return config.read_supplemental_dict(base_cfg) diff --git a/moonraker/components/update_manager/update_manager.py b/moonraker/components/update_manager/update_manager.py index aaa9237..73b4a6e 100644 --- a/moonraker/components/update_manager/update_manager.py +++ b/moonraker/components/update_manager/update_manager.py @@ -109,9 +109,10 @@ class UpdateManager: cfg = config[section] name = section.split()[-1] if name in self.updaters: - self.server.add_warning( - f"[update_manager]: Extension {name} already added" - ) + if name not in ["klipper", "moonraker"]: + self.server.add_warning( + f"[update_manager]: Extension {name} already added" + ) continue try: client_type = cfg.get("type")