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')
Exemple #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
Exemple #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)
Exemple #4
0
    def __init__(self, cursor):

        self.cursor = cursor
        self.version_id = self.get_version()
        self.update_versiontagscan()
        Kodi.__init__(self)
    def __init__(self, cursor):

        self.cursor = cursor
        Kodi.__init__(self, cursor)
def test_withoutXbmc_getMonitor_waitForAbort_shouldDoNothing():
    proxy = mocks.Proxy()
    kodi = Kodi(proxy, None)
    kodi.getMonitor().waitForAbort(1)
def test_withoutXbmc_getMonitor_isAbortRequested_shouldReturnFalse():
    proxy = mocks.Proxy()
    kodi = Kodi(proxy, None)
    assert kodi.getMonitor().abortRequested() is False
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