From d9e108488049343c2bfa29af0a22ddc0776a2c45 Mon Sep 17 00:00:00 2001 From: ndrsnhs Date: Thu, 25 Sep 2025 15:40:28 +0200 Subject: [PATCH 1/2] change update order --- packages/helpermodules/command.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/packages/helpermodules/command.py b/packages/helpermodules/command.py index 41067b8c1f..3db8dac1b7 100644 --- a/packages/helpermodules/command.py +++ b/packages/helpermodules/command.py @@ -819,6 +819,16 @@ def systemUpdate(self, connection_id: str, payload: dict) -> None: Pub().pub("openWB/system/update_in_progress", False) return parent_file = Path(__file__).resolve().parents[2] + if not SubData.general_data.data.extern and SubData.system_data["system"].data["secondary_auto_update"]: + for cp in SubData.cp_data.values(): + # if chargepoint is external_openwb and not the second CP of duo and version is Release + if ( + cp.chargepoint.chargepoint_module.config.type == 'external_openwb' and + cp.chargepoint.chargepoint_module.config.configuration.duo_num == 0 and + cp.chargepoint.data.get.current_branch == "Release" + ): + time.sleep(2) + self.secondaryChargepointUpdate({"data": {"chargepoint": f"cp{cp.chargepoint.num}"}}) if "branch" in payload["data"] and "tag" in payload["data"]: pub_user_message( payload, connection_id, @@ -833,16 +843,6 @@ def systemUpdate(self, connection_id: str, payload: dict) -> None: run_command([ str(parent_file / "runs" / "update_self.sh"), SubData.system_data["system"].data["current_branch"]]) - if not SubData.general_data.data.extern and SubData.system_data["system"].data["secondary_auto_update"]: - for cp in SubData.cp_data.values(): - # if chargepoint is external_openwb and not the second CP of duo and version is Release - if ( - cp.chargepoint.chargepoint_module.config.type == 'external_openwb' and - cp.chargepoint.chargepoint_module.config.configuration.duo_num == 0 and - cp.chargepoint.data.get.current_branch == "Release" - ): - time.sleep(2) - self.secondaryChargepointUpdate({"data": {"chargepoint": f"cp{cp.chargepoint.num}"}}) def systemFetchVersions(self, connection_id: str, payload: dict) -> None: log.info("Fetch versions requested") From 51ea8eeba1af1e9db37e0699ac502d1d87e4328b Mon Sep 17 00:00:00 2001 From: ndrsnhs Date: Fri, 26 Sep 2025 09:27:45 +0200 Subject: [PATCH 2/2] improve syntax --- packages/helpermodules/command.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/helpermodules/command.py b/packages/helpermodules/command.py index 3db8dac1b7..c973bdfe1f 100644 --- a/packages/helpermodules/command.py +++ b/packages/helpermodules/command.py @@ -822,9 +822,9 @@ def systemUpdate(self, connection_id: str, payload: dict) -> None: if not SubData.general_data.data.extern and SubData.system_data["system"].data["secondary_auto_update"]: for cp in SubData.cp_data.values(): # if chargepoint is external_openwb and not the second CP of duo and version is Release - if ( - cp.chargepoint.chargepoint_module.config.type == 'external_openwb' and - cp.chargepoint.chargepoint_module.config.configuration.duo_num == 0 and + if all( + cp.chargepoint.chargepoint_module.config.type == 'external_openwb', + cp.chargepoint.chargepoint_module.config.configuration.duo_num == 0, cp.chargepoint.data.get.current_branch == "Release" ): time.sleep(2)