SHDR Connector Schemas#
SHDR Connector Schemas
This module provides Pydantic models to define and validate configuration schemas for SHDR devices within OpenFactory.
Key Models:#
-
Configuration for a single SHDR data point. Contains a
tagused by OpenFactory to label incoming SHDR data and atypedefining the type of the data point (SamplesorEvents). -
Wrapper schema that encapsulates the SHDR server configuration along with all configured SHDR data points.
Validation Features:#
Validates
portrange (1-65535).Restricts SHDR data point
typetoSamplesorEvents.Forbids unknown fields to ensure strict schema conformance.
Supports immutable validated configuration models.
YAML Example:#
type: shdr
host: 192.168.1.10
port: 7878
data:
temp:
tag: Temperature
type: Samples
humi:
tag: Humidity
type: Events
See also
The runtime class of the SHDRConnectorSchema schema is
openfactory.connectors.shdr.shdr_connector.SHDRConnector.
- class openfactory.schemas.connectors.shdr.SHDRConnectorSchema(**data)[source]#
Bases:
BaseModelSHDR Connector schema wrapping the server configuration.
The
typefield is a discriminator for Pydantic to select this schema.See also
The runtime class of the
SHDRConnectorSchemaschema isopenfactory.connectors.shdr.shdr_connector.SHDRConnector.- data: Dict[str, SHDRDataPointSchema]#
- model_config = {'extra': 'forbid', 'frozen': True}#
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].