update_manager: update base channel config

Allow independent channel configuration for Moonraker and
Klipper.

Signed-off-by:  Eric Callahan <arksine.code@gmail.com>
This commit is contained in:
Eric Callahan 2023-06-27 11:59:37 -04:00
parent a1e786fd73
commit 5f43536612
No known key found for this signature in database
GPG Key ID: 5A1EB336DFB4C71B
2 changed files with 13 additions and 7 deletions

View File

@ -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)

View File

@ -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")