Beispiel #1
0
 def __init__(self, tid, name, pin):
     Sensor.__init__(self, tid, name, pin, "temperature")
     self.add_property(
         Property(name="temperature", unit="°C", range=[0, 100]))
     self.add_property(Property(name="humidity", unit="%", range=[0, 100]))
     self.temperature = 0
     self.humidity = 0
Beispiel #2
0
 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
Beispiel #3
0
 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, "temperature")
     self.add_property(
         Property(name="temperature",
                  type=PropertyType.INT,
                  value=0,
                  unit="°C",
                  range=[0, 100]))
     self.add_property(
         Property(name="humidity",
                  type=PropertyType.INT,
                  value=0,
                  unit="%",
                  range=[0, 100]))
 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
Beispiel #6
0
 def __init__(self, tid, name, pin):
     Sensor.__init__(self, tid, name, pin, "angle")
     self.add_property(
         Property(name="angle",
                  type=PropertyType.INT,
                  value=0,
                  unit="°",
                  range=[0, 100]))
Beispiel #7
0
 def __init__(self, tid, name, pin):
     Sensor.__init__(self, tid, name, pin, "distance")
     self.add_property(Property(name="distance", unit="cm"))
     self.distance = 0
 def __init__(self, tid, name, pin):
     Sensor.__init__(self, tid, name, pin, "light")
     self.add_property(Property(name="value", unit="Nit"))
     self.value = 0
Beispiel #9
0
 def __init__(self, tid, name, pin):
     Sensor.__init__(self, tid, name, pin, "sound")
     self.add_property(Property(name="volume", unit="dB"))
     self.volume = 0
 def __init__(self, tid, name):
     Thing.__init__(self, tid, name, "cpu")
     self.add_property(Property(name="CPU_usage", unit="%"))
     self.add_property(Property(name="memory_usage", unit="%"))
 def __init__(self, tid, name, pin):
     Sensor.__init__(self, tid, name, pin, "angle")
     self.add_property(Property(name="angle", unit="°", range=[0, 100]))
     self.angle = 0
 def __init__(self, tid, name, pin):
     Sensor.__init__(self, tid, name, pin, "sound")
     self.add_property(
         Property(name="volume", type=PropertyType.INT, value=0, unit="dB"))
 def __init__(self, tid, name, pin):
     Sensor.__init__(self, tid, name, pin, "button")
     self.add_property(Property("pressed", PropertyTypeBool))
     self.pressed = False
 def __init__(self, tid, name, pin):
     Sensor.__init__(self, tid, name, pin, "distance")
     self.add_property(
         Property(name="distance", type=PropertyType.INT, unit="cm"))
 def __init__(self, tid, name, pin):
     Sensor.__init__(self, tid, name, pin, "button")
     self.add_property(Property("pressed", PropertyType.BOOL))
 def __init__(self, tid, name, pin):
     Sensor.__init__(self, tid, name, pin, "temperature")
     self.add_property(Property(name="value", unit="°C", range=[0, 100]))
     self.value = 0