Пример #1
0
    def construct_from_jdict(cls, jdict):
        if not jdict:
            return None

        if 'calibrated_on' in jdict:  # TODO: deprecated
            date = Datum.date(jdict.get('calibrated_on'))
            calibrated_on = LocalizedDatetime.construct_from_date(date)

        else:
            calibrated_on = Datum.datetime(jdict.get('calibrated-on'))

        v20 = jdict.get('v20')

        return Pt1000Calib(calibrated_on, v20)
Пример #2
0
    def construct_from_jdict(cls, jdict):
        if not jdict:
            return SensorBaseline(None, 0, None)

        if 'calibrated_on' in jdict:                            # TODO: deprecated
            date = Datum.date(jdict.get('calibrated_on'))
            calibrated_on = LocalizedDatetime.construct_from_date(date)

        else:
            calibrated_on = Datum.datetime(jdict.get('calibrated-on'))

        offset = jdict.get('offset')
        environment = BaselineEnvironment.construct_from_jdict(jdict.get('env'))

        return SensorBaseline(calibrated_on, offset, environment)