示例#1
0
    def __init__(self,
                 sensor_id,
                 sensor_type,
                 address,
                 name='',
                 callback_indicator=None):
        self.__firmware = None
        self.__battery = None
        self.__sensor_cache = terrariumSensorCache()

        if sensor_type in ['light', 'fertility']:
            self.set_limit_max(1000)

        super(terrariumMiFloraSensor,
              self).__init__(sensor_id, sensor_type, address, name,
                             callback_indicator)
    def __init__(self,
                 sensor_id,
                 sensor_type,
                 address,
                 name='',
                 callback_indicator=None,
                 adapter=0):
        self.__firmware = None
        self.__battery = None
        self.__adaptor = 'hci{}'.format(adapter)
        self.__sensor_cache = terrariumSensorCache()

        self.__device = None

        super(terrariumMiTempSensor,
              self).__init__(sensor_id, sensor_type, address, name,
                             callback_indicator)