flexmeasures.api.common.schemas.sensors
Classes
- class flexmeasures.api.common.schemas.sensors.SensorField(entity_type: str = 'sensor', fm_scheme: str = 'fm1', *args, **kwargs)
Field that de-serializes to a Sensor, and serializes a Sensor into an entity address (string).
- class flexmeasures.api.common.schemas.sensors.SensorIdField(*, strict: bool = False, **kwargs)
Field that represents a sensor ID. It de-serializes from the sensor id to a sensor instance.
- _deserialize(sensor_id: int, attr, obj, **kwargs) Sensor
Deserialize value. Concrete
Field
classes should implement this method.- Parameters:
value – The value to be deserialized.
attr – The attribute/key in data to be deserialized.
data – The raw input data passed to the Schema.load.
kwargs – Field-specific keyword arguments.
- Raises:
ValidationError – In case of formatting or validation failure.
- Returns:
The deserialized value.
Changed in version 2.0.0: Added
attr
anddata
parameters.Changed in version 3.0.0: Added
**kwargs
to signature.
Exceptions