def onInit(self): log('IntegraService init.') self.model = self.config.get('model') self.ser_dev = self.config.get('serial') if self.ser_dev and self.model: self.topics, self.cmds = iscp.model_cmds(self.model) else: log.error('Service needs serial service and model to work.') sys.exit(1) self.act_desc = { 'info': 'Integra/Onkyo model %s' % self.model, 'actions': [] } for cmd in self.cmds: for subcmd in cmd: newcmd = { 'name': cmd + subcmd, 'info': self.cmds[cmd][subcmd]['description'], 'args': [ ] } if 'type' in self.cmds[cmd][subcmd]: param = self._type_desc(self.cmds[cmd][subcmd]['type']) if param: newcmd['args'].append(param) self.act_desc['actions'].append(newcmd) self.ser = serial.Serial(port=self.ser_dev, baudrate=9600, timeout=0.05, # 50ms reponse time according to spec bytesize=serial.EIGHTBITS, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, )
def onInit(self): log('Starting Supervisor service') self.interval = self.config.getInt('interval') or 300 # seconds self.server = xmlrpclib.ServerProxy( 'http://127.0.0.1', transport=supervisor.xmlrpc.SupervisorTransport( None, None, 'unix:///var/run/supervisor.sock'))
def onStart(self): log('IntegraService starting.') while not self._shutdown: # TODO: check for self.command variable, and run command here # rather than from runAction()? line = self.ser.readline() if line: self.sendEvent(line[1:4], {'value': line[4:]}) # TODO: sleep probably not needed? time.sleep(0.1)
def onInit(self): log('Starting Supervisor service') self.interval = self.config.getInt('interval') or 300 # seconds self.server = xmlrpclib.ServerProxy( 'http://127.0.0.1', transport=supervisor.xmlrpc.SupervisorTransport( None, None, 'unix:///var/run/supervisor.sock' ) )
def onStart(self): log('BenqService starting.') meta = {'type': 'screen', 'device': 'projector'} if self.location: meta.update({'location': self.location}) while not self._shutdown: line = self.ser.readline() if line: change = benq.parse(line) self.sendEvent('change', change, meta) # TODO: sleep probably not needed? time.sleep(0.1)
def onInit(self): log('BenqService init.') self.model = self.config.get('model') or 'W6000' self.location = self.config.get('location') self.ser_dev = self.config.get('serial') or '/dev/ttyUSB0' self.ser = serial.Serial(port=self.ser_dev, baudrate=115200, timeout=0.05, # TODO: What is spec? bytesize=serial.EIGHTBITS, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, )
def onInit(self): log('BenqService init.') self.model = self.config.get('model') or 'W6000' self.location = self.config.get('location') self.ser_dev = self.config.get('serial') or '/dev/ttyUSB0' self.ser = serial.Serial( port=self.ser_dev, baudrate=115200, timeout=0.05, # TODO: What is spec? bytesize=serial.EIGHTBITS, parity=serial.PARITY_NONE, stopbits=serial.STOPBITS_ONE, )
def onInit(self): log("SensorTag init") self.interval = self.config.getInt("interval") or 1000 # milliseconds
def onInit(self): log('CV image init.')
def onStart(self): log('USBHub starting.') while not self._shutdown: # TODO: send port status every <interval> seconds time.sleep(self.interval)
def onInit(self): log('USBHub init.') self.interval = self.config.get('interval') or 60
def onInit(self): log('SensorTag init') self.interval = self.config.getInt('interval') or 1000 # milliseconds