Exemplo n.º 1
0
 def attemptConnection(self, ip_address, port, username, password):
     kodi = Kodi(username, password, ip_address, port)
     isConnected = kodi.Connect()
     if isConnected:
         print('Connected. Load remote window')
         self.builder.get_object('windowSetup').hide()
         remoteWin = Remote({'ip_address': ip_address, 'port': port, 'username': username, 'password': password})
         remoteWin.load_window(self.builder)
     else:
         print('Unable to connect. Keep showing setup window')
Exemplo n.º 2
0
 def load_window(self, builder):
     window = builder.get_object("windowRemote")
     window.set_title('KodiLinuxRemote')
     window.show()
     # Communicate with kodi
     kodi = Kodi(self.username, self.password, self.ip_address, self.port)
     # Alter UI based on currently playing media
     self.load_now_playing(kodi, builder)
     return kodi
Exemplo n.º 3
0
 def _createServices(self, eventloop):
     """Hardcoding a list of services - later we might add auto-detection of services present"""
     Airconditioner(self, self.config, eventloop)
     AutoShade(self, self.config, eventloop)
     AutoLight(self, self.config, eventloop)
     HiFi(self, self.config, eventloop)
     IrTrans(self, self.config, eventloop)
     Kodi(self, self.config, eventloop)
     Paradox(self, self.config, eventloop)
     Projector(self, self.config, eventloop)
     Scene(self, self.config, eventloop)
     Schedule(self, self.config, eventloop)
     SleepSense(self, self.config, eventloop)
     SunRiseSet(self, self.config, eventloop)
     ZWaveMios(self, self.config, eventloop)
     # let's make this last:
     TcpServer(self, self.config, eventloop)
Exemplo n.º 4
0
    def __init__(self, cursor):

        self.cursor = cursor
        self.version_id = self.get_version()
        self.update_versiontagscan()
        Kodi.__init__(self)
Exemplo n.º 5
0
    def __init__(self, cursor):

        self.cursor = cursor
        Kodi.__init__(self, cursor)
Exemplo n.º 6
0
def test_withoutXbmc_getMonitor_waitForAbort_shouldDoNothing():
    proxy = mocks.Proxy()
    kodi = Kodi(proxy, None)
    kodi.getMonitor().waitForAbort(1)
Exemplo n.º 7
0
def test_withoutXbmc_getMonitor_isAbortRequested_shouldReturnFalse():
    proxy = mocks.Proxy()
    kodi = Kodi(proxy, None)
    assert kodi.getMonitor().abortRequested() is False
Exemplo n.º 8
0
def test_getMonitor_isAbortRequested_shouldReturnTrue():
    xbmc = mocks.Xbmc()
    proxy = mocks.Proxy()
    kodi = Kodi(proxy, xbmc)
    mocks.Xbmc.abortRequested = True
    assert kodi.getMonitor().abortRequested() is True