Added ADC measurements

This commit is contained in:
Ayzen
2026-05-06 14:52:31 +03:00
parent 31fd8ab111
commit 431666046f
7 changed files with 27 additions and 7 deletions

View File

@ -35,6 +35,8 @@ class Measurements:
current2: float
temp1: float
temp2: float
adc_pf3_voltage: float = 0.0
adc_pf4_voltage: float = 0.0
temp_ext1: float | None = None
temp_ext2: float | None = None
voltage_3v3: float = 0.0
@ -42,8 +44,6 @@ class Measurements:
voltage_5v2: float = 0.0
voltage_7v0: float = 0.0
message_id: int | None = None
to6_counter_lsb: int | None = None
to6_counter_msb: int | None = None
timestamp: datetime = field(default_factory=datetime.now)
def to_dict(self) -> dict[str, Any]:
@ -51,6 +51,8 @@ class Measurements:
return {
"current1": self.current1,
"current2": self.current2,
"adc_pf3_voltage": self.adc_pf3_voltage,
"adc_pf4_voltage": self.adc_pf4_voltage,
"temp1": self.temp1,
"temp2": self.temp2,
"temp_ext1": self.temp_ext1,
@ -60,8 +62,6 @@ class Measurements:
"voltage_5v2": self.voltage_5v2,
"voltage_7v0": self.voltage_7v0,
"message_id": self.message_id,
"to6_counter_lsb": self.to6_counter_lsb,
"to6_counter_msb": self.to6_counter_msb,
"timestamp": self.timestamp.isoformat(),
}