Skip to content

Commit fc1a3ef

Browse files
committed
Expose frequency as a field in MeterData objects
Signed-off-by: Sahas Subramanian <[email protected]>
1 parent 2f34f71 commit fc1a3ef

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/frequenz/sdk/microgrid/component_data.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,11 +71,13 @@ class MeterData(ComponentData):
7171
-ve current means supply into the grid.
7272
voltage_per_phase: the AC voltage in Volts (V) between the line and the neutral
7373
wire for phase/line 1,2 and 3 respectively.
74+
frequency: the AC power frequency in Hertz (Hz).
7475
"""
7576

7677
active_power: float
7778
current_per_phase: Tuple[float, float, float]
7879
voltage_per_phase: Tuple[float, float, float]
80+
frequency: float
7981

8082
@classmethod
8183
def from_proto(cls, raw: microgrid_pb.ComponentData) -> MeterData:
@@ -101,6 +103,7 @@ def from_proto(cls, raw: microgrid_pb.ComponentData) -> MeterData:
101103
raw.meter.data.ac.phase_2.voltage.value,
102104
raw.meter.data.ac.phase_3.voltage.value,
103105
),
106+
frequency=raw.meter.data.ac.frequency.value,
104107
)
105108
meter_data._set_raw(raw=raw)
106109
return meter_data

0 commit comments

Comments
 (0)