def __init__(self, temp, scale): """ __value: from Sensor class __scale: from Sensor class :param temp: to associate with this temperature data instance :param scale: to associate with this scale data instance """ #Using the Sensor class initialiser Sensor.__init__(self, temp, scale)
def __init__(self, humidity, scale): """ Initialiser- instance variable: __value: from Sensor class __scale: from Sensor class :param humidity: to associate with this humidity data instance :param scale: to associate with this scale data instance """ #Using the Sensor class initialiser Sensor.__init__(self,humidity,scale)
def __init__(self, id, description, update_interval): self.ambient = self.randomFromTupel(AMBIENT_TEMPERATURE) self.time = None self.time_last_active = None self.time_next_active = self.randomFromTupel(WATER_BOILER_FIRST_ACTIVE) self.time_last_cooldown = None self.active = False self.active_step = None self.active_begin = None self.cooldown = False self.cooldown_step = None self.cooldown_begin = None Sensor.__init__(self, id, description, update_interval)
def __init__(self, retriever, rtimer, displayer): """ @retriever : function that retrieves data @type retriever: callable, returns True when new data available. @rtimer : function that return a sleep duration @type rtimer : callable. Returns int > 0. @displayer : function that displays data @type displayer : callable On config changed, only @displayer is called. @retriever lives is life, polling data and calling @displayer when needed. That's the best we can do with these old deprecated Sensor. """ Sensor.__init__(self) self.__retriever = retriever self.__rtimer = rtimer self.__displayer = displayer self.__retriever_event = threading.Event() self.__displayer_event = threading.Event() self.watch_stop( self.__on_stop ) self.watch_config( self.__on_update ) def once(): self.add_thread( self.__retriever_thread ) self.add_thread( self.__displayer_thread ) self._start = None self._start = once
def __init__(self, name, id, min, max): Sensor.__init__(self, name, min, max) self.__id = id
def __init__(self, location): Sensor.__init__(self, location)
def __init__(self, callback): Sensor.__init__(self) self.callback = callback GPIO.add_event_detect(PIN_BUTTON, GPIO.RISING, callback=lambda channel: self.trigger(channel))
def __init__(self, frecuencia, pins): Sensor.__init__(self, frecuencia) self.pins = pins # ubicacion es un arreglo que contiene el numero de los pines en modo BCM
def __init__(self, id, pin): Sensor.__init__(self, id, pin)
def __init__(self, port, filename): self.conn = RxConnector(port, 'UDP') self.log = open(filename, 'wb') Sensor.__init__(self)
def __init__(self,ubicacion, frecuencia): Sensor.__init__(self, ubicacion, frecuencia) self.tipo = "HUMEDAD Y TEMPERATURA" GPIO.setmode(GPIO.BCM) # Usa el sistema de nombramiento BCM - la otra alternatica es BOARD
def __init__(self, callback): Sensor.__init__(self) self.callback = callback GPIO.add_event_detect(PIN_PIR, GPIO.FALLING, callback=lambda channel: self.trigger(channel))
def __init__(self, type, id, channel, batteryHigh): Sensor.__init__(self, type) self.__type = type self.__id = id self.__channel = channel self.__battery = batteryHigh
def __init__(self, disk, min, max): Sensor.__init__(self, 'Disk %s' % disk, min, max) self.__disk = disk self.__time = -1 self.setInterval(300)
def __init__(self): Sensor.__init__(self) APIThread().start()
def __init__(self): Sensor.__init__(self) ServerThread().start()