FraunhoferIOSB / FROST-Python-Client

Python Client Library for FROST.
GNU Lesser General Public License v3.0
8 stars 8 forks source link

Datastream.unitOfMeasurement is a JSONObject #32

Open securedimensions opened 5 months ago

securedimensions commented 5 months ago

Description

According to the SensorThings API Standard v1.1 (Table 10. Properties of a Datastream entity) the unitOfMeasurement property is a JSONObject

Datastream.py code

The implementation enforces that the unitOfMeasurement is of type UnitOfMeasurement:

    @unit_of_measurement.setter
    def unit_of_measurement(self, value):
        if value is None or isinstance(value, unitofmeasurement.UnitOfMeasurement):
            self._unit_of_measurement = value
            return
        raise ValueError('unitOfMeasurement should be of type UnitOfMeasurement!')