From 28714cc9797f7ce6af6094aba013be04a45801fb Mon Sep 17 00:00:00 2001 From: LKuemmel Date: Mon, 2 Jun 2025 10:46:31 +0200 Subject: [PATCH 1/2] smartWB: fix phases in use --- packages/modules/chargepoints/smartwb/chargepoint_module.py | 5 +---- packages/modules/common/store/_chargepoint.py | 3 ++- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/packages/modules/chargepoints/smartwb/chargepoint_module.py b/packages/modules/chargepoints/smartwb/chargepoint_module.py index 76fe27bd21..6164256842 100644 --- a/packages/modules/chargepoints/smartwb/chargepoint_module.py +++ b/packages/modules/chargepoints/smartwb/chargepoint_module.py @@ -20,7 +20,6 @@ def __init__(self, config: SmartWB) -> None: "Ladepunkt", "chargepoint")) self.client_error_context = ErrorTimerContext( f"openWB/set/chargepoint/{self.config.id}/get/error_timestamp", CP_ERROR, hide_exception=True) - self.old_phases_in_use = 1 self.session = req.get_http_session() def set_current(self, current: float) -> None: @@ -57,9 +56,7 @@ def get_values(self) -> None: phases_in_use = sum(1 for current in currents if current > 3) if phases_in_use == 0: - phases_in_use = self.old_phases_in_use - else: - self.old_phases_in_use = phases_in_use + phases_in_use = None if json_rsp.get("voltageP1"): voltages = [json_rsp["voltageP1"], json_rsp["voltageP2"], json_rsp["voltageP3"]] diff --git a/packages/modules/common/store/_chargepoint.py b/packages/modules/common/store/_chargepoint.py index 7b818fce0c..478560bbd2 100644 --- a/packages/modules/common/store/_chargepoint.py +++ b/packages/modules/common/store/_chargepoint.py @@ -41,7 +41,8 @@ def update(self): pub_to_broker("openWB/set/chargepoint/" + str(self.num) + "/get/power", self.state.power, 2) pub_to_broker("openWB/set/chargepoint/" + str(self.num) + "/get/powers", self.state.powers, 2) pub_to_broker("openWB/set/chargepoint/" + str(self.num) + "/get/frequency", self.state.frequency, 2) - pub_to_broker("openWB/set/chargepoint/" + str(self.num) + "/get/phases_in_use", self.state.phases_in_use, 2) + if self.state.phases_in_use: + pub_to_broker("openWB/set/chargepoint/" + str(self.num) + "/get/phases_in_use", self.state.phases_in_use, 2) pub_to_broker("openWB/set/chargepoint/" + str(self.num) + "/get/charge_state", self.state.charge_state, 2) pub_to_broker("openWB/set/chargepoint/" + str(self.num) + "/get/plug_state", self.state.plug_state, 2) pub_to_broker("openWB/set/chargepoint/" + str(self.num) + "/get/rfid", self.state.rfid) From 1dd419cc7cad3528e7f0ca70d594bc6da3579fd5 Mon Sep 17 00:00:00 2001 From: LKuemmel Date: Mon, 2 Jun 2025 10:53:49 +0200 Subject: [PATCH 2/2] fix pytest --- packages/modules/chargepoints/smartwb/smartwb_test.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/modules/chargepoints/smartwb/smartwb_test.py b/packages/modules/chargepoints/smartwb/smartwb_test.py index 32890476a3..0a5f04ba57 100644 --- a/packages/modules/chargepoints/smartwb/smartwb_test.py +++ b/packages/modules/chargepoints/smartwb/smartwb_test.py @@ -101,7 +101,7 @@ class TestSmartWb: charge_state=True, rfid="0a1b2c3d", rfid_timestamp=1652683252, - phases_in_use=1, + phases_in_use=None, serial_number="94:B9:7E:69:F0:D1", max_evse_current=16 )