async def test_connection(self):
        """Test the connection to Tautulli."""
        cmd = 'get_server_friendly_name'
        url = self.base_url + cmd
        try:
            async with async_timeout.timeout(8, loop=self._loop):
                response = await self._session.get(url)
                connectionstate = await response.json()
                if connectionstate['response']['message']:
                    self.connection = False
                else:
                    self.connection = True
            logger("Status from Tautulli: " + str(response.status))

        except (asyncio.TimeoutError, aiohttp.ClientError, socket.gaierror,
                AttributeError) as error:
            msg = "Can not load data from Tautulli: {} - {}".format(url, error)
            logger(msg, 40)
async def test_connection ( self ) : cmd = 'get_server_friendly_name' url = self . base_url + cmd try : async with async_timeout . timeout ( 8 , loop = self . _loop ) : response = await self . _session . get ( url ) connectionstate = await response . json ( ) if connectionstate [ 'response' ] [ 'message' ] : self . connection = False else : self . connection = True logger ( "Status from Tautulli: " + str ( response . status ) ) except ( asyncio . TimeoutError , aiohttp . ClientError , socket . gaierror , AttributeError ) as error : msg = "Can not load data from Tautulli: {} - {}" . format ( url , error ) logger ( msg , 40 )
Test the connection to Tautulli.