Skip to content

Commit

Permalink
Fix flaky voltage, add current total
Browse files Browse the repository at this point in the history
  • Loading branch information
frenck committed Dec 21, 2024
1 parent 678b9b5 commit 29e644e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/peblar/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,11 @@ class PeblarMeter(BaseModel):
power_phase_2: int = field(metadata=field_options(alias="PowerPhase2"))
power_phase_3: int = field(metadata=field_options(alias="PowerPhase3"))
power_total: int = field(metadata=field_options(alias="PowerTotal"))
voltage_phase_1: int = field(metadata=field_options(alias="VoltagePhase1"))
voltage_phase_1: int | None = field(metadata=field_options(alias="VoltagePhase1"))
voltage_phase_2: int | None = field(metadata=field_options(alias="VoltagePhase2"))
voltage_phase_3: int | None = field(metadata=field_options(alias="VoltagePhase3"))

@property
def current_total(self) -> int:
"""Return the total current of the Peblar charger."""
return self.current_phase_1 + self.current_phase_2 + self.current_phase_3

0 comments on commit 29e644e

Please sign in to comment.