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_RESET = 'contactor/reset_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.DCSourceApiUrl(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)ď
Bases:
Enum
An Enum containing urls for the DC Source API of the testbench
- DC_STATUS = 'dcsource/dcstatus'ď
- 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'ď
- POWER_MEASURED = 'power_measured'ď
- 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.DcState(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)ď
Bases:
Enum
An enum containing the states of DC Source
- OFF = 'off'ď
- ON = 'on'ď
- 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.PowerSetpoints(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)ď
Bases:
Enum
An Enum containing Power Setpoints for different Manufacturers
- FOX_1000 = 'fox_1000'ď
- FOX_3000 = 'fox_2000'ď
- FOX_5000 = 'fox_5000'ď
- HUAWEI_1000 = 'huawei_1000'ď
- HUAWEI_3000 = 'huawei_2000'ď
- HUAWEI_5000 = 'huawei_5000'ď
- SUNGROW_1000 = 'sungrow_1000'ď
- SUNGROW_3000 = 'sungrow_2000'ď
- SUNGROW_5000 = 'sungrow_5000'ď
- TEST = 'Test'ď
- 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.TemperatureTag(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)ď
Bases:
Enum
An Enum containing values for temeperature tags
- VORLAUF = 'vorlauf'ď
- 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'ď