Example #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)
Example #2
0
    def construct_from_jdict(cls, jdict):
        if not jdict:
            return SensorBaseline(None, 0)

        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 = Datum.int(jdict.get('offset'))

        return SensorBaseline(calibrated_on, offset)