Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ def __init__(self, config: OpenWBseries2Satellit) -> None:
f"openWB/set/chargepoint/{self.config.id}/get/error_timestamp", CP_ERROR, hide_exception=True)
self._create_client()
self._validate_version()
self.old_phases_in_use = 3

def delay_second_cp(self, delay: float):
if self.config.configuration.duo_num == 0:
Expand Down Expand Up @@ -82,12 +83,15 @@ def get_values(self) -> None:
if self.version is False:
self._validate_version()

currents = counter_state.currents
phases_in_use = sum(1 for current in currents if current > 3)
phases_in_use = sum(1 for current in counter_state.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

chargepoint_state = ChargepointState(
power=counter_state.power,
currents=currents,
currents=counter_state.currents,
imported=counter_state.imported,
exported=0,
voltages=counter_state.voltages,
Expand All @@ -106,7 +110,7 @@ def get_values(self) -> None:
chargepoint_state = ChargepointState(
plug_state=None, charge_state=False, imported=None,
# bei im-/exported None werden keine Werte gepublished
exported=None, phases_in_use=0, power=0, currents=[0]*3)
exported=None, phases_in_use=self.old_phases_in_use, power=0, currents=[0]*3)
self.store.set(chargepoint_state)
except AttributeError:
self._create_client()
Expand Down