def __init__(self, tid, name, pin): Sensor.__init__(self, tid, name, pin, "led") self.add_action(Action("turn_on")) self.add_action(Action("turn_off")) self.add_action(Action("blink"). add_parameter(Property(name="duration", value=10, range=[10, 100])). add_parameter(Property(name="interval", value=1, range=[1, 10]))) self.working_thread = None
def __init__(self, tid, name, pin): Sensor.__init__(self, tid, name, pin) self.add_action(Action("turn_on")) self.add_action(Action("turn_off")) self.add_action( Action("flash").add_parameter( Property(name="duration", type=PropertyType.INT, value=10, range=[10, 100])).add_parameter( Property(name="interval", type=PropertyType.INT, value=1, range=[1, 10]))) self.working_thread = None
def __init__(self, tid, name): Thing.__init__(self, tid, name, "mock") self.add_action( Action("beep").add_parameter( Property(name="duration", type=PropertyType.INT, value=10, range=[10, 100])).add_parameter( Property(name="interval", type=PropertyType.INT, value=1, range=[1, 10]))) self.options = {}
def __init__(self, tid, name, pin): Sensor.__init__(self, tid, name, pin, "lcd") self.add_action(Action("display", message=PropertyTypeString))