def __init__(self, fp): self.__client = XBMCClient("KissMe remote") self.__client.connect() self.__fp = fp
class KissKodi: def __init__(self, fp): self.__client = XBMCClient("KissMe remote") self.__client.connect() self.__fp = fp def handle_inputevent(self, ie): action = button_to_action(ie.key) if action != None: if(ie.type == InputEventType.hold): if(ie.key == 'volume_down') or (ie.key == 'volume_up'): self.__client.send_action(action, ACTION_BUTTON) self.__fp.set_text(str(action)) elif(ie.type == InputEventType.pressed): self.__client.send_action(action, ACTION_BUTTON) self.__fp.set_text(str(action)) def stop(self): self.__client.send_action('Stop',ACTION_BUTTON) def ping(self): self.__client.ping() def connect(self): self.__client.connect() def disconnect(self): self.__client.close()
class KissKodi: def __init__(self, fp): self.__client = XBMCClient("KissMe remote") self.__client.connect() self.__fp = fp def handle_inputevent(self, ie): action = button_to_action(ie.key) if action != None: if (ie.type == InputEventType.hold): if (ie.key == 'volume_down') or (ie.key == 'volume_up'): self.__client.send_action(action, ACTION_BUTTON) self.__fp.set_flash_text(10, '{:^12}'.format(str(action))) elif (ie.type == InputEventType.pressed): self.__client.send_action(action, ACTION_BUTTON) self.__fp.set_flash_text(10, '{:^12}'.format(str(action))) def stop(self): self.__client.send_action('Stop', ACTION_BUTTON) def ping(self): self.__client.ping() def connect(self): self.__client.connect() def disconnect(self): self.__client.close()