def __init__(self, sensor_table, srv): self.light_sensor = LightSensor() self.mutex = esp.mutex() self.sensor_table = sensor_table self.sensors = dict() self.task = esp.os_task(callback=lambda task: handler(task, srv, self)) for sensor_name, sensor_port in sensor_table.items(): self.sensors[sensor_name] = Sensor(sensor_name, sensor_port, 10000, task=self.task, mutex=self.mutex) pyb.udelay(10000)
def __init__(self): self.os_task = esp.os_task(callback=lambda tm: self.handler(tm)) self.dqueues = dict() self.bhandler = ButtonHandler() self.wem = WifiEventManager()
def __init__(self): self.os_task = esp.os_task(callback=lambda tm: self.handler(tm)) self.actions = dict()