def execute(self): super(XBMCRequest, self).execute() if self.action == constants.REQUEST_XBMC_ACTION_GET: if self.cmd == 'player': self.answer = xbmcremote.getActivePlayer() if self.cmd == 'volume': self.answer = xbmcremote.getVolume() if self.action == constants.REQUEST_XBMC_ACTION_SET: if self.cmd == 'notification': self.answer = xbmcremote.showNotification(self.request['params'][0], self.request['params'][1]) if self.cmd == 'playpause': self.answer = xbmcremote.playPause() if self.cmd == 'stop': self.answer = xbmcremote.stop() if self.cmd == 'next': self.answer = xbmcremote.next() if self.cmd == 'previous': self.answer = xbmcremote.previous() if self.cmd == 'volume': self.answer = xbmcremote.setVolume(int(self.request['params'][0])) if self.cmd == 'volup': self.answer = xbmcremote.volumeUp() if self.cmd == 'voldown': self.answer = xbmcremote.volumeDown() if self.action == constants.REQUEST_XBMC_ACTION_CMD: self.answer = xbmcremote.sendCommand(self.cmd) answer = {"type":self.type, self.action:self.cmd, "answer":self.answer} return answer
def onFadeEnd(self, seconds, startColor, endColor): if not self.finishTrigger.check(): xbmcremote.stop() self.finish()
def onFadeStep(self, seconds, startColor, endColor, progress): if not self.finishTrigger.check(): xbmcremote.stop() self.finish()
def onChangeColor(self, newColor): if not self.finishTrigger.check(): xbmcremote.stop() self.finish()