30 lines
1.4 KiB
Python
30 lines
1.4 KiB
Python
from pydantic import BaseModel, Field
|
|
|
|
class ThreePhasePowerState(BaseModel):
|
|
"""
|
|
State model for a three-phase power meter.
|
|
|
|
Required fields:
|
|
- energy: Total energy in kWh
|
|
- total_power: Total power in W
|
|
- phase1_power, phase2_power, phase3_power: Power per phase in W
|
|
- phase1_voltage, phase2_voltage, phase3_voltage: Voltage per phase in V
|
|
- phase1_current, phase2_current, phase3_current: Current per phase in A
|
|
"""
|
|
energy: float = Field(..., description="Total energy in kWh")
|
|
total_power: float = Field(..., description="Total power in W")
|
|
phase1_power: float = Field(..., description="Power for phase 1 in W")
|
|
phase2_power: float = Field(..., description="Power for phase 2 in W")
|
|
phase3_power: float = Field(..., description="Power for phase 3 in W")
|
|
phase1_voltage: float = Field(..., description="Voltage for phase 1 in V")
|
|
phase2_voltage: float = Field(..., description="Voltage for phase 2 in V")
|
|
phase3_voltage: float = Field(..., description="Voltage for phase 3 in V")
|
|
phase1_current: float = Field(..., description="Current for phase 1 in A")
|
|
phase2_current: float = Field(..., description="Current for phase 2 in A")
|
|
phase3_current: float = Field(..., description="Current for phase 3 in A")
|
|
|
|
|
|
# Capability metadata
|
|
CAP_VERSION = "three_phase_powermeter@1.0.0"
|
|
DISPLAY_NAME = "Three-Phase Power Meter"
|