Skip to content

Commit f29b08c

Browse files
authored
Merge branch 'openWB:master' into improvement/speed-up-boot-time
2 parents 1d42379 + 2e82f99 commit f29b08c

2 files changed

Lines changed: 6 additions & 3 deletions

File tree

packages/modules/chargepoints/smartwb/chargepoint_module.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ def __init__(self, config: SmartWB) -> None:
2121
self.client_error_context = ErrorTimerContext(
2222
f"openWB/set/chargepoint/{self.config.id}/get/error_timestamp", CP_ERROR, hide_exception=True)
2323
self.session = req.get_http_session()
24+
self.old_phases_in_use = 3
2425

2526
def set_current(self, current: float) -> None:
2627
if self.client_error_context.error_counter_exceeded():
@@ -56,7 +57,9 @@ def get_values(self) -> None:
5657

5758
phases_in_use = sum(1 for current in currents if current > 3)
5859
if phases_in_use == 0:
59-
phases_in_use = None
60+
phases_in_use = self.old_phases_in_use
61+
else:
62+
self.old_phases_in_use = phases_in_use
6063

6164
if json_rsp.get("voltageP1"):
6265
voltages = [json_rsp["voltageP1"], json_rsp["voltageP2"], json_rsp["voltageP3"]]
@@ -97,7 +100,7 @@ def get_values(self) -> None:
97100
imported=None,
98101
exported=None,
99102
currents=[0]*3,
100-
phases_in_use=0,
103+
phases_in_use=self.old_phases_in_use,
101104
power=0)
102105
self.store.set(chargepoint_state)
103106

packages/modules/chargepoints/smartwb/smartwb_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class TestSmartWb:
102102
plug_state=True,
103103
charge_state=True,
104104
rfid="0a1b2c3d",
105-
phases_in_use=None,
105+
phases_in_use=3,
106106
serial_number="94:B9:7E:69:F0:D1",
107107
max_evse_current=16
108108
)

0 commit comments

Comments
 (0)