testframework.clients.brain_datamodel module
Datamodel for Contactor API and DC Source API & MQTT Measurements
- class testframework.clients.brain_datamodel.AcPowerMeasurementCollection(*, Datetime: datetime, SamplingPoint: SamplingPoint, VoltageL1: Measurement | None = None, VoltageL2: Measurement | None = None, VoltageL3: Measurement | None = None, CurrentL1: Measurement | None = None, CurrentL2: Measurement | None = None, CurrentL3: Measurement | None = None, PowerL1: Measurement | None = None, PowerL2: Measurement | None = None, PowerL3: Measurement | None = None, PowerTotal: Measurement | None = None, Frequency: Measurement | None = None, EnergyFeedIn: Measurement | None = None, EnergyPurchased: Measurement | None = None)
Bases:
MeasurementCollection
A dataclass describing measurement collection of AC Power Meter for a sampling point Attributes are initialized with a default value of None. Values are assigned when Modbus registers are successfully read.
- CurrentL1: Measurement | None
- CurrentL2: Measurement | None
- CurrentL3: Measurement | None
- EnergyFeedIn: Measurement | None
- EnergyPurchased: Measurement | None
- Frequency: Measurement | None
- PowerL1: Measurement | None
- PowerL2: Measurement | None
- PowerL3: Measurement | None
- PowerTotal: Measurement | None
- VoltageL1: Measurement | None
- VoltageL2: Measurement | None
- VoltageL3: Measurement | None
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'CurrentL1': FieldInfo(annotation=Union[Measurement, NoneType], required=False, default=None), 'CurrentL2': FieldInfo(annotation=Union[Measurement, NoneType], required=False, default=None), 'CurrentL3': FieldInfo(annotation=Union[Measurement, NoneType], required=False, default=None), 'Datetime': FieldInfo(annotation=datetime, required=True), 'EnergyFeedIn': FieldInfo(annotation=Union[Measurement, NoneType], required=False, default=None), 'EnergyPurchased': FieldInfo(annotation=Union[Measurement, NoneType], required=False, default=None), 'Frequency': FieldInfo(annotation=Union[Measurement, NoneType], required=False, default=None), 'PowerL1': FieldInfo(annotation=Union[Measurement, NoneType], required=False, default=None), 'PowerL2': FieldInfo(annotation=Union[Measurement, NoneType], required=False, default=None), 'PowerL3': FieldInfo(annotation=Union[Measurement, NoneType], required=False, default=None), 'PowerTotal': FieldInfo(annotation=Union[Measurement, NoneType], required=False, default=None), 'SamplingPoint': FieldInfo(annotation=SamplingPoint, required=True), 'VoltageL1': FieldInfo(annotation=Union[Measurement, NoneType], required=False, default=None), 'VoltageL2': FieldInfo(annotation=Union[Measurement, NoneType], required=False, default=None), 'VoltageL3': FieldInfo(annotation=Union[Measurement, NoneType], required=False, default=None)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class testframework.clients.brain_datamodel.ContactorApiUrl(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
Enum
An Enum containing urls for contactor API of the testbench
- CONTACTOR_ALL = 'contactor/all'
- CONTACTOR_STATE = 'contactor/'
- class testframework.clients.brain_datamodel.ContactorMetaData(*, contactor_point: ContactorPoints, contactor_pin: int, contactor_init_state: ContactorState, contactor_type: ContactorType)
Bases:
BaseModel
A dataclass describing a Contactor
- contactor_init_state: ContactorState
- contactor_pin: int
- contactor_point: ContactorPoints
- contactor_type: ContactorType
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'contactor_init_state': FieldInfo(annotation=ContactorState, required=True), 'contactor_pin': FieldInfo(annotation=int, required=True), 'contactor_point': FieldInfo(annotation=ContactorPoints, required=True), 'contactor_type': FieldInfo(annotation=ContactorType, required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class testframework.clients.brain_datamodel.ContactorPoints(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
Enum
An Enum containing urls for contactor API of testframework
- ACBOX_24V = 'contactor_acbox_24v'
- AC_POWER_DCSOURCE = 'contactor_ac_power_dcsource'
- DC_LOADPATH_TB13 = 'contactor_dc_loadpath_tb13'
- DC_LOADPATH_TB14 = 'contactor_dc_loadpath_tb14'
- DC_LOADPATH_TB15 = 'contactor_dc_loadpath_tb15'
- DC_LOADPATH_TB26 = 'contactor_dc_loadpath_tb26'
- DUT = 'contactor_deviceundertest'
- ENGPIN = 'contactor_engPin'
- EQUIPMENT = 'contactor_equipment'
- EVCONNECTED = 'contactor_evconnected'
- EVERROR = 'contactor_everror'
- EVREADY = 'contactor_evready'
- EVREADYFAN = 'contactor_evreadyfan'
- GRID = 'contactor_grid'
- IOT_ENGPIN = 'contactor_iot_engpin'
- LOADALL = 'contactor_loadAll'
- LOADL1 = 'contactor_loadL1'
- LOADL2 = 'contactor_loadL2'
- LOADL3 = 'contactor_loadL3'
- SCHUKO = 'contactor_schuko'
- WBACBOX = 'contactor_wbacbox'
- WBLOADL1 = 'contactor_wbloadL1'
- WBLOADL2 = 'contactor_wbloadL2'
- WBLOADL3 = 'contactor_wbloadL3'
- class testframework.clients.brain_datamodel.ContactorState(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
Enum
An enum containing the states of a contactor
- OFF = 'off'
- ON = 'on'
- class testframework.clients.brain_datamodel.ContactorType(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
Enum
An enum containing contactor types
- NC = 'nc'
- NO = 'no'
- class testframework.clients.brain_datamodel.DcPowerMeasurementCollection(*, Datetime: datetime, SamplingPoint: SamplingPoint, Voltage: Measurement, Current: Measurement, Power: Measurement)
Bases:
MeasurementCollection
A dataclass describing a Measurement collection of a DC Power Meter for a sampling point
- Current: Measurement
- Power: Measurement
- Voltage: Measurement
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'Current': FieldInfo(annotation=Measurement, required=True), 'Datetime': FieldInfo(annotation=datetime, required=True), 'Power': FieldInfo(annotation=Measurement, required=True), 'SamplingPoint': FieldInfo(annotation=SamplingPoint, required=True), 'Voltage': FieldInfo(annotation=Measurement, required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class testframework.clients.brain_datamodel.DcSourceOpMode(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
Enum
An enum containing operation modes of DC Source
- PVSIM = 'PVSIM'
- SKRIPT = 'SKRIPT'
- UI = 'UI'
- UIP = 'UIP'
- UIR = 'UIR'
- USER = 'USER'
- class testframework.clients.brain_datamodel.DcSourceParam(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
Enum
An enum containing remote modes of DC Source
- MEASURED = 'measured'
- MPP = 'mpp'
- SETTING = 'setting'
- class testframework.clients.brain_datamodel.DcSourceRemoteMode(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
Enum
An enum containing remote modes of DC Source
- ASO = '2'
- DAR = '0'
- OFA = '1'
- class testframework.clients.brain_datamodel.DcSourceStandbyMode(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
Enum
An enum containing remote modes of DC Source
- OFF = 'R'
- ON = '1'
- class testframework.clients.brain_datamodel.DcSourceTag(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
Enum
An enum containing values of sampling points for an inverter bench
- CURRENT_MEASURED = 'current_measured'
- CURRENT_MPP = 'current_mpp'
- CURRENT_SETTING = 'current_setting'
- OPERATION_MODE = 'operation_mode'
- REMOTE = 'remote'
- STANDBY = 'standby'
- VOLTAGE_MEASURED = 'voltage_measured'
- VOLTAGE_MPP = 'voltage_mpp'
- VOLTAGE_SETTING = 'voltage_setting'
- class testframework.clients.brain_datamodel.DcSourceVariable(*, dcsource_tag: DcSourceTag, measurement: Measurement)
Bases:
BaseModel
A dataclass describing a single DC Source measurement
- dcsource_tag: DcSourceTag
- measurement: Measurement
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'dcsource_tag': FieldInfo(annotation=DcSourceTag, required=True), 'measurement': FieldInfo(annotation=Measurement, required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class testframework.clients.brain_datamodel.FrameworkApiUrl(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
Enum
An Enum containing urls for the framework API of the testbench
- TESTBENCH_TYPE = 'testframework/testbench_type'
- class testframework.clients.brain_datamodel.Measurement(*, value: float, unit: UnitType)
Bases:
BaseModel
A dataclass describing a single measurement
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'unit': FieldInfo(annotation=UnitType, required=True), 'value': FieldInfo(annotation=float, required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- value: float
- class testframework.clients.brain_datamodel.MeasurementCollection(*, Datetime: datetime, SamplingPoint: SamplingPoint)
Bases:
BaseModel
A dataclass describing a Measurement collection of a Power Meter for a sampling point
- Datetime: datetime
- SamplingPoint: SamplingPoint
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[dict[str, FieldInfo]] = {'Datetime': FieldInfo(annotation=datetime, required=True), 'SamplingPoint': FieldInfo(annotation=SamplingPoint, required=True)}
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].
This replaces Model.__fields__ from Pydantic V1.
- class testframework.clients.brain_datamodel.PowerVariables(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
Enum
An enum containing power variables names
- CURRENTL1 = 'CurrentL1'
- CURRENTL2 = 'CurrentL2'
- CURRENTL3 = 'CurrentL3'
- ENERGYFEEDIN = 'EnergyFeedIn'
- ENERGYPURCHASED = 'EnergyPurchased'
- FREQUENCY = 'Frequency'
- POWERL1 = 'PowerL1'
- POWERL2 = 'PowerL2'
- POWERL3 = 'PowerL3'
- POWERTOTAL = 'PowerTotal'
- VOLTAGEL1 = 'VoltageL1'
- VOLTAGEL2 = 'VoltageL2'
- VOLTAGEL3 = 'VoltageL3'
- class testframework.clients.brain_datamodel.SamplingPoint(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
Enum
An enum containing values of sampling points for power meter
- ACBOX = 'acbox'
- BATTERY = 'battery'
- GRID = 'grid'
- LOAD = 'load'
- WALLBOX1 = 'wb1'
- WALLBOX2 = 'wb2'
- class testframework.clients.brain_datamodel.UnitType(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)
Bases:
str
,Enum
enum containing possible Unit Types
- A = 'A'
- AH = 'Ah'
- CELCIUS = '°C'
- HZ = 'Hz'
- KILOOHM = 'KiloOhm'
- KVA = 'kVA'
- KW = 'kW'
- KWH = 'kWh'
- MA = 'mA'
- MEGAOHM = 'MegaOhm'
- MINUTES = 'Minutes'
- NONE = 'None'
- NONE_ = 'None'
- OHM = 'Ohm'
- PERCENT = 'Percent'
- V = 'V'
- VA = 'VA'
- W = 'W'
- WH = 'Wh'