powermon.configmodel.port_config_model module¶
pydantic definitions for the powermon port config model
- class powermon.configmodel.port_config_model.BlePortConfig(*, type: Literal['ble'], mac: str, protocol: None | str, victron_key: None | str = None)¶
Bases:
NoExtraBaseModel
model/allowed elements for ble port config
- model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[Dict[str, FieldInfo]] = {'mac': FieldInfo(annotation=str, required=True), 'protocol': FieldInfo(annotation=Union[NoneType, str], required=True), 'type': FieldInfo(annotation=Literal['ble'], required=True), 'victron_key': FieldInfo(annotation=Union[NoneType, str], required=False, default=None, repr=False)}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.
This replaces Model.__fields__ from Pydantic V1.
- class powermon.configmodel.port_config_model.SerialPortConfig(*, type: Literal['serial'], path: str, baud: None | int = None, protocol: None | str)¶
Bases:
NoExtraBaseModel
model/allowed elements for serial port config
- model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[Dict[str, FieldInfo]] = {'baud': FieldInfo(annotation=Union[NoneType, int], required=False, default=None), 'path': FieldInfo(annotation=str, required=True), 'protocol': FieldInfo(annotation=Union[NoneType, str], required=True), 'type': FieldInfo(annotation=Literal['serial'], required=True)}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.
This replaces Model.__fields__ from Pydantic V1.
- class powermon.configmodel.port_config_model.TestPortConfig(*, type: Literal['test'], response_number: None | int = None, protocol: None | str = None)¶
Bases:
NoExtraBaseModel
model/allowed elements for test port config
- model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[Dict[str, FieldInfo]] = {'protocol': FieldInfo(annotation=Union[NoneType, str], required=False, default=None), 'response_number': FieldInfo(annotation=Union[NoneType, int], required=False, default=None), 'type': FieldInfo(annotation=Literal['test'], required=True)}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.
This replaces Model.__fields__ from Pydantic V1.
- class powermon.configmodel.port_config_model.UsbPortConfig(*, type: Literal['usb'], path: None | str, protocol: None | str)¶
Bases:
NoExtraBaseModel
model/allowed elements for usb port config
- model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_config: ClassVar[ConfigDict] = {'extra': 'forbid'}¶
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- model_fields: ClassVar[Dict[str, FieldInfo]] = {'path': FieldInfo(annotation=Union[NoneType, str], required=True), 'protocol': FieldInfo(annotation=Union[NoneType, str], required=True), 'type': FieldInfo(annotation=Literal['usb'], required=True)}¶
Metadata about the fields defined on the model, mapping of field names to [FieldInfo][pydantic.fields.FieldInfo] objects.
This replaces Model.__fields__ from Pydantic V1.