示例#1
0
    def __init__(self, sensor=23, initialValue="Off"):
        Observable.__init__(self,initialValue)
        self.sensor=sensor
        GPIO.setmode(GPIO.BCM)
        GPIO.setwarnings(False)
        GPIO.setup(self.sensor,GPIO.IN,GPIO.PUD_DOWN)
        GPIO.add_event_detect(self.sensor,GPIO.BOTH,self.sensorChange)
        logger.info("Sensor init")

        self.led = LED(24)
示例#2
0
 def __init__(self, device='ttyUSB0', initialValue="Off"):
     Observable.__init__(self, initialValue)
     self.ser = serial.Serial(
         port='/dev/' + device,
         baudrate=19200,
         parity=serial.PARITY_NONE,
         stopbits=serial.STOPBITS_ONE,
         bytesize=serial.EIGHTBITS,
         timeout=1
     )
     logger.info("Planar OLED init")
示例#3
0
 def __init__(self,ipaddy,filepath,active,idle,initialValue="Offline"):
     Observable.__init__(self,initialValue)
     self.ipaddy=ipaddy
     self.port=8900
     self.filepath=filepath
     self.active=active
     self.idle=idle
     self.activeplaying=False
     self.idleplaying=False
     self.parse=False
     self.currentList=Observable()
     self.allLists=Observable()
     self.getCurrentList()
示例#4
0
 def __init__(self, ipaddy, filepath, active, idle, initialValue="Offline"):
     Observable.__init__(self, initialValue)
     self.ipaddy = ipaddy
     self.port = 8900
     self.filepath = filepath
     self.active = active
     self.idle = idle
     self.activeplaying = False
     self.idleplaying = False
     self.parse = False
     self.currentList = Observable()
     self.allLists = Observable()
     self.getCurrentList()
示例#5
0
 def __init__(self, port=1, initialValue="Off"):
     Observable.__init__(self, initialValue)
     self.port = port
     GPIO.setup(self.port, GPIO.OUT)
     GPIO.output(self.port, GPIO.LOW)
     logger.info("LED init")