testframework.clients.ops_datamodel module

Datamodel for Operations Container API

class testframework.clients.ops_datamodel.Comparators(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

An enum containing the possible Comparators

BIGGER = 'Bigger'
BIGGEREQUAL = 'BiggerEqual'
EQUAL = 'Equal'
INBETWEEN = 'InBetween'
SMALLER = 'Smaller'
SMALLEREQUAL = 'SmallerEqual'
class testframework.clients.ops_datamodel.DatapointValue(*, globalSensorName: str = 'Not defined', text: str | None = None, number: float | None = None, rawRegisterValues: List[int] | None = None, unit: UnitType, timeStampUtc: datetime = None)

Bases: BaseModel

The DTO object for a single data point coming from the modbus container

datapoint_id: str
model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}

A dictionary of computed field names and their corresponding ComputedFieldInfo objects.

model_config: ClassVar[ConfigDict] = {'populate_by_name': True, 'use_enum_values': False}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

model_fields: ClassVar[dict[str, FieldInfo]] = {'datapoint_id': FieldInfo(annotation=str, required=False, default='Not defined', alias='globalSensorName', alias_priority=2), 'number': FieldInfo(annotation=Union[float, NoneType], required=False, default=None, alias='number', alias_priority=2), 'raw_register_values': FieldInfo(annotation=Union[List[int], NoneType], required=False, default=None, alias='rawRegisterValues', alias_priority=2), 'text': FieldInfo(annotation=Union[str, NoneType], required=False, default=None, alias='text', alias_priority=2), 'time_stamp_utc': FieldInfo(annotation=datetime, required=False, default_factory=<lambda>, alias='timeStampUtc', alias_priority=2), 'unit': FieldInfo(annotation=UnitType, required=True, alias='unit', alias_priority=2)}

Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo].

This replaces Model.__fields__ from Pydantic V1.

number: float | None
raw_register_values: List[int] | None
text: str | None
time_stamp_utc: datetime
unit: UnitType
class testframework.clients.ops_datamodel.DatapointValuesHttpResponse(*, values: List[DatapointValue], errors: Dict[str, str])

Bases: BaseModel

The response when requesting all values Also returns errors for when a certain data point could not be obtained

errors: Dict[str, str]
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]] = {'errors': FieldInfo(annotation=Dict[str, str], required=True), 'values': FieldInfo(annotation=List[DatapointValue], 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.

values: List[DatapointValue]
class testframework.clients.ops_datamodel.DeviceClass(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

Device classes of system

BATTERY = 'Battery'
DONGLE = 'Dongle'
INVERTER = 'Inverter'
class testframework.clients.ops_datamodel.DeviceManufacturer(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

Manufacturer of Device

FOX = 'fox'
HUAWEI = 'huawei'
SUNGROW = 'sungrow'
class testframework.clients.ops_datamodel.GlobalSensorName(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

An enum containing global sensor names

BATTERY_SOH = 'Battery.SOH'
CODE_DEVICE_TYPE = 'Code.Device.Type'
CODE_INVERTER_COUNTRY = 'Code.Inverter.Country'
CODE_INVERTER_GRID = 'Code.Inverter.Grid'
COMMAND_EMS_MODE = 'Command.EMS.Mode'
COMMAND_START_STOP = 'Command.Start.Stop'
CPU_LOAD = 'Cpu.Load'
CURRENT_BATTERY = 'Current.Battery'
CURRENT_STRING_1 = 'Current.String.1'
CURRENT_STRING_2 = 'Current.String.2'
CURRENT_WALLBOX_CONNECTOR_1_PHASE_A = 'Current.Wallbox.Connector.1.Phase.A'
CURRENT_WALLBOX_CONNECTOR_1_PHASE_B = 'Current.Wallbox.Connector.1.Phase.B'
CURRENT_WALLBOX_CONNECTOR_1_PHASE_C = 'Current.Wallbox.Connector.1.Phase.C'
DONGLE_BACKENDCONNECTION = 'Dongle.BackendConnection'
DONGLE_BATTERYCOUNT = 'Dongle.BatteryCount'
DONGLE_BATTERY_NODE_1 = 'Dongle.Battery.Node.1'
DONGLE_BATTERY_NODE_2 = 'Dongle.Battery.Node.2'
DONGLE_CUSTOMERIDENT = 'Dongle.CustomerIdent'
DONGLE_LOCALACCESS = 'Dongle.LocalAccess'
DONGLE_POWERMETER_NODE = 'Dongle.PowerMeter.Node'
ENERGY_BATTERY_CAPACITY = 'Energy.Battery.Capacity'
ENERGY_BATTERY_CHARGE_DAY = 'Energy.Battery.Charge.Day'
ENERGY_BATTERY_CHARGE_LEVEL = 'Energy.Battery.Charge.Level'
ENERGY_BATTERY_CHARGE_LOAD = 'Energy.Battery.Charge.Load'
ENERGY_BATTERY_DISCHARGE_DAY = 'Energy.Battery.Discharge.Day'
ENERGY_CONSUMPTION_TOTAL_DAY = 'Energy.Consumption.Total.Day'
ENERGY_EXTERNAL_TOTAL_IN_DAY = 'Energy.External.Total.In.Day'
ENERGY_EXTERNAL_TOTAL_OUT_DAY = 'Energy.External.Total.Out.Day'
ENERGY_GRID_EXPORT_DAY = 'Energy.Grid.Export.Day'
ENERGY_GRID_IMPORT_DAY = 'Energy.Grid.Import.Day'
ENERGY_PRODUCTION_TOTAL_DAY = 'Energy.Production.Total.Day'
ENERGY_STORAGE_LEVEL = 'Energy.Storage.Level'
ENERGY_STORAGE_TOTAL_IN_DAY = 'Energy.Storage.Total.In.Day'
ENERGY_STORAGE_TOTAL_OUT_DAY = 'Energy.Storage.Total.Out.Day'
ENERGY_WALLBOX_CONNECTOR_1_CHARGED_TOTAL = 'Energy.Wallbox.Connector.1.Charged.Total'
FREQUENCY_GRID = 'Frequency.Grid'
INVERTER_RUNNING_STATE = 'Inverter.Running.State'
INVERTER_SYSTEM_STATE = 'Inverter.System.State'
LTE_PREDICTOR_RESULT_PASSED = 'LTE.Predictor.Result.Passed'
LTE_QUALITY = 'LTE.Quality'
MEMORY_USAGE = 'Memory.Usage'
MODE_FORCIBLE_CHARGE_DISCHARGE = 'Mode.Forcible.Charge.Discharge'
PERCENT_STORAGE_LEVEL = 'Percent.Storage.Level'
POWER_AC_PHASE_A = 'Power.AC.Phase.A'
POWER_AC_PHASE_B = 'Power.AC.Phase.B'
POWER_AC_PHASE_C = 'Power.AC.Phase.C'
POWER_BATTERY_CHARGE_DISCHARGE = 'Power.Battery.Charge.Discharge'
POWER_BATTERY_CHARGE_DISCHARGE_SET = 'Power.Battery.Charge.Discharge.Set'
POWER_CONSUMPTION_TOTAL = 'Power.Consumption.Total'
POWER_DC_STRING_1 = 'Power.DC.String.1'
POWER_DC_STRING_2 = 'Power.DC.String.2'
POWER_DC_TOTAL = 'Power.DC.Total'
POWER_EXTERNAL_TOTAL = 'Power.External.Total'
POWER_GRID_EXPORT = 'Power.Grid.Export'
POWER_HOUSE_TOTAL = 'Power.House.Total'
POWER_OUTPUT_NOMINAL = 'Power.Output.Nominal'
POWER_POWERMETER_ACTIVE = 'Power.PowerMeter.Active'
POWER_PRODUCTION_TOTAL = 'Power.Production.Total'
POWER_STORAGE_TOTAL = 'Power.Storage.Total'
POWER_WALLBOX_CONNECTOR_0_CHARGING_REQUESTED = 'Power.Wallbox.Connector.0.Charging.Requested'
POWER_WALLBOX_CONNECTOR_1_CHARGING = 'Power.Wallbox.Connector.1.Charging'
POWER_WALLBOX_CONNECTOR_1_CHARGING_REQUESTED = 'Power.Wallbox.Connector.1.Charging.Requested'
POWER_WALLBOX_CONNECTOR_1_OFFERED = 'Power.Wallbox.Connector.1.Offered'
SOFTWARE_VERSION_SERVICE_1 = 'SoftwareVersion.Service.1'
SOFTWARE_VERSION_SERVICE_2 = 'SoftwareVersion.Service.2'
STATE_ALARMCODES_1 = 'State.AlarmCodes.1'
STATE_ALARMCODES_10 = 'State.AlarmCodes.10'
STATE_ALARMCODES_11 = 'State.AlarmCodes.11'
STATE_ALARMCODES_12 = 'State.AlarmCodes.12'
STATE_ALARMCODES_13 = 'State.AlarmCodes.13'
STATE_ALARMCODES_14 = 'State.AlarmCodes.14'
STATE_ALARMCODES_15 = 'State.AlarmCodes.15'
STATE_ALARMCODES_2 = 'State.AlarmCodes.2'
STATE_ALARMCODES_3 = 'State.AlarmCodes.3'
STATE_ALARMCODES_4 = 'State.AlarmCodes.4'
STATE_ALARMCODES_5 = 'State.AlarmCodes.5'
STATE_ALARMCODES_6 = 'State.AlarmCodes.6'
STATE_ALARMCODES_7 = 'State.AlarmCodes.7'
STATE_ALARMCODES_8 = 'State.AlarmCodes.8'
STATE_ALARMCODES_9 = 'State.AlarmCodes.9'
STATE_ERRORCODES_1 = 'State.ErrorCodes.1'
STATE_ERRORCODES_10 = 'State.ErrorCodes.10'
STATE_ERRORCODES_11 = 'State.ErrorCodes.11'
STATE_ERRORCODES_2 = 'State.ErrorCodes.2'
STATE_ERRORCODES_6 = 'State.ErrorCodes.6'
STATE_ERRORCODES_9 = 'State.ErrorCodes.9'
STATE_WALLBOX_CONNECTOR_1_CHARGE = 'State.Wallbox.Connector.1.Charge'
STATUS_WALLBOX_CONNECTED = 'Status.Wallbox.Connected'
TEMPERATURE_BATTERY = 'Temperature.Battery'
TEMPERATURE_HOUSING_INSIDE = 'Temperature.Housing.Inside'
VOLTAGE_BATTERY = 'Voltage.Battery'
VOLTAGE_PHASE_A = 'Voltage.Phase.A'
VOLTAGE_PHASE_B = 'Voltage.Phase.B'
VOLTAGE_PHASE_C = 'Voltage.Phase.C'
VOLTAGE_STRING_1 = 'Voltage.String.1'
VOLTAGE_STRING_2 = 'Voltage.String.2'
VOLTAGE_WALLBOX_CONNECTOR_1_PHASE_A = 'Voltage.Wallbox.Connector.1.Phase.A'
VOLTAGE_WALLBOX_CONNECTOR_1_PHASE_B = 'Voltage.Wallbox.Connector.1.Phase.B'
VOLTAGE_WALLBOX_CONNECTOR_1_PHASE_C = 'Voltage.Wallbox.Connector.1.Phase.C'
class testframework.clients.ops_datamodel.GlobalSensorNameInverterBatch1(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

An enum containing global sensor names batch1 for an Inverter Bench

ENERGY_EXTERNAL_TOTAL_IN_DAY = 'Energy.External.Total.In.Day'
ENERGY_EXTERNAL_TOTAL_OUT_DAY = 'Energy.External.Total.Out.Day'
ENERGY_PRODUCTION_TOTAL_DAY = 'Energy.Production.Total.Day'
ENERGY_STORAGE_LEVEL = 'Energy.Storage.Level'
ENERGY_STORAGE_TOTAL_IN_DAY = 'Energy.Storage.Total.In.Day'
ENERGY_STORAGE_TOTAL_OUT_DAY = 'Energy.Storage.Total.Out.Day'
PERCENT_STORAGE_LEVEL = 'Percent.Storage.Level'
POWER_EXTERNAL_TOTAL = 'Power.External.Total'
POWER_PRODUCTION_TOTAL = 'Power.Production.Total'
POWER_STORAGE_TOTAL = 'Power.Storage.Total'
class testframework.clients.ops_datamodel.GlobalSensorNameInverterBatch2(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

An enum containing global sensor names batch2 for an Inverter Bench

CURRENT_STRING_1 = 'Current.String.1'
CURRENT_STRING_2 = 'Current.String.2'
ENERGY_BATTERY_CHARGE_LOAD = 'Energy.Battery.Charge.Load'
ENERGY_CONSUMPTION_TOTAL_DAY = 'Energy.Consumption.Total.Day'
MODE_FORCIBLE_CHARGE_DISCHARGE = 'Mode.Forcible.Charge.Discharge'
POWER_BATTERY_CHARGE_DISCHARGE = 'Power.Battery.Charge.Discharge'
POWER_BATTERY_CHARGE_DISCHARGE_SET = 'Power.Battery.Charge.Discharge.Set'
POWER_CONSUMPTION_TOTAL = 'Power.Consumption.Total'
POWER_DC_TOTAL = 'Power.DC.Total'
POWER_WALLBOX_CONNECTOR_0_CHARGING_REQUESTED = 'Power.Wallbox.Connector.0.Charging.Requested'
VOLTAGE_PHASE_A = 'Voltage.Phase.A'
VOLTAGE_STRING_1 = 'Current.String.1'
VOLTAGE_STRING_2 = 'Voltage.String.1'
class testframework.clients.ops_datamodel.GlobalSensorNameInverterBatch3(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

An enum containing global sensor names batch3 for an Inverter Bench

ENERGY_GRID_EXPORT_DAY = 'Energy.Grid.Export.Day'
ENERGY_GRID_IMPORT_DAY = 'Energy.Grid.Import.Day'
FREQUENCY_GRID = 'Frequency.Grid'
POWER_AC_PHASE_A = 'Power.AC.Phase.A'
POWER_AC_PHASE_B = 'Power.AC.Phase.B'
POWER_DC_STRING_1 = 'Power.DC.String.1'
POWER_DC_STRING_2 = 'Power.DC.String.2'
POWER_GRID_EXPORT = 'Power.Grid.Export'
POWER_HOUSE_TOTAL = 'Power.House.Total'
POWER_POWERMETER_ACTIVE = 'Power.PowerMeter.Active'
VOLTAGE_PHASE_B = 'Voltage.Phase.B'
VOLTAGE_PHASE_C = 'Voltage.Phase.C'
class testframework.clients.ops_datamodel.GlobalSensorNameInverterBatch4(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

An enum containing global sensor names batch4 for an Inverter Bench

BATTERY_SOH = 'Battery.SOH'
CURRENT_BATTERY = 'Current.Battery'
ENERGY_BATTERY_CAPACITY = 'Energy.Battery.Capacity'
ENERGY_BATTERY_CHARGE_DAY = 'Energy.Battery.Charge.Day'
ENERGY_BATTERY_CHARGE_LEVEL = 'Energy.Battery.Charge.Level'
ENERGY_BATTERY_DISCHARGE_DAY = 'Energy.Battery.Discharge.Day'
INVERTER_RUNNING_STATE = 'Inverter.Running.State'
POWER_AC_PHASE_C = 'Power.AC.Phase.C'
POWER_WALLBOX_CONNECTOR_1_CHARGING_REQUESTED = 'Power.Wallbox.Connector.1.Charging.Requested'
STATUS_WALLBOX_CONNECTED = 'Status.Wallbox.Connected'
TEMPERATURE_BATTERY = 'Temperature.Battery'
VOLTAGE_BATTERY = 'Voltage.Battery'
class testframework.clients.ops_datamodel.GlobalSensorNameWallboxBatch1(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

An enum containing batch1 global sensor names for an Wallbox Bench

COUNT_WALLBOX_CONNECTOR_1_PHASES_CHARGING = 'Count.Wallbox.Connector.1.Phases.Charging'
CPU_LOAD = 'Cpu.Load'
CURRENT_WALLBOX_CONNECTOR_1_PHASE_A = 'Current.Wallbox.Connector.1.Phase.A'
CURRENT_WALLBOX_CONNECTOR_1_PHASE_B = 'Current.Wallbox.Connector.1.Phase.B'
class testframework.clients.ops_datamodel.GlobalSensorNameWallboxBatch2(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

An enum containing batch2 global sensor names for an Wallbox Bench

CURRENT_WALLBOX_CONNECTOR_1_PHASE_C = 'Current.Wallbox.Connector.1.Phase.C'
ENERGY_WALLBOX_CONNECTOR_1_CHARGED_TOTAL = 'Energy.Wallbox.Connector.1.Charged.Total'
LTE_PREDICTOR_RESULT_PASSED = 'LTE.Predictor.Result.Passed'
LTE_QUALITY = 'LTE.Quality'
MEMORY_USAGE = 'Memory.Usage'
class testframework.clients.ops_datamodel.GlobalSensorNameWallboxBatch3(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

An enum containing batch3 global sensor names for an Wallbox Bench

POWER_WALLBOX_CONNECTOR_0_CHARGING_REQUESTED = 'Power.Wallbox.Connector.0.Charging.Requested'
POWER_WALLBOX_CONNECTOR_1_CHARGING = 'Power.Wallbox.Connector.1.Charging'
POWER_WALLBOX_CONNECTOR_1_CHARGING_REQUESTED = 'Power.Wallbox.Connector.1.Charging.Requested'
POWER_WALLBOX_CONNECTOR_1_OFFERED = 'Power.Wallbox.Connector.1.Offered'
STATE_WALLBOX_CONNECTOR_1_CHARGE = 'State.Wallbox.Connector.1.Charge'
class testframework.clients.ops_datamodel.GlobalSensorNameWallboxBatch4(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

An enum containing batch4 global sensor names for an Wallbox Bench

STATUS_WALLBOX_CONNECTED = 'Status.Wallbox.Connected'
VOLTAGE_WALLBOX_CONNECTOR_1_PHASE_A = 'Voltage.Wallbox.Connector.1.Phase.A'
VOLTAGE_WALLBOX_CONNECTOR_1_PHASE_B = 'Voltage.Wallbox.Connector.1.Phase.B'
VOLTAGE_WALLBOX_CONNECTOR_1_PHASE_C = 'Voltage.Wallbox.Connector.1.Phase.C'
class testframework.clients.ops_datamodel.MiscDataPointId(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

MODE_FORCIBLE_TIMEOUT = 'Mode.Forcible.Timeout'
class testframework.clients.ops_datamodel.OpsApiUrl(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

An Enum containing urls for operation container api

CONFIG_DEFAULTS_EP = 'pv/config/defaults'
DATA_EP = 'data'
DEVICE_PROPERTIES_EP = 'devices/all/properties'
GRID_CONTROLS_LPC_EP = 'gridControls/lpc'
GRID_CONTROLS_LPP_EP = 'gridControls/lpp'
PV_ACTION_EP = 'pv/action'
PV_DATA_EP = 'pv/data'
WALLBOX_EP = 'wallbox'
exception testframework.clients.ops_datamodel.SensorValueTimeoutException

Bases: Exception

Raised when waiting for a sensor value exceeds the set timeout