def fetchMyCgi(self):
        """Fetches statistics from my_cgi.cgi"""
        try:
            response = urlopen(Request('http://{}/my_cgi.cgi'.format(self.ip), b'request=create_chklst'));
        except (HTTPError, URLError):
            _LOGGER.warning("Failed to open url to {}".format(self.ip))
            self._error_report = True
            return None

        lines = response.readlines()
        return {line.decode().split(':')[0].strip(): line.decode().split(':')[1].strip() for line in lines}
def fetchMyCgi ( self ) : try : response = urlopen ( Request ( 'http://{}/my_cgi.cgi' . format ( self . ip ) , b'request=create_chklst' ) ) ; except ( HTTPError , URLError ) : _LOGGER . warning ( "Failed to open url to {}" . format ( self . ip ) ) self . _error_report = True return None lines = response . readlines ( ) return { line . decode ( ) . split ( ':' ) [ 0 ] . strip ( ) : line . decode ( ) . split ( ':' ) [ 1 ] . strip ( ) for line in lines }
Fetches statistics from my_cgi.cgi