'Send a get request, and return the response as a dict.'

def get(self, endpoint):

    now = time.time()
    if (endpoint == 'job'):
        last_time = self.job_last_reading[1]
        if (last_time is not None):
            if ((now - last_time) < 30.0):
                return self.job_last_reading[0]
    elif (endpoint == 'printer'):
        last_time = self.printer_last_reading[1]
        if (last_time is not None):
            if ((now - last_time) < 30.0):
                return self.printer_last_reading[0]
    url = (self.api_url + endpoint)
    try:
        response = requests.get(url, headers=self.headers, timeout=9)
        response.raise_for_status()
        if (endpoint == 'job'):
            self.job_last_reading[0] = response.json()
            self.job_last_reading[1] = time.time()
            self.job_available = True
        elif (endpoint == 'printer'):
            self.printer_last_reading[0] = response.json()
            self.printer_last_reading[1] = time.time()
            self.printer_available = True
        self.available = (self.printer_available and self.job_available)
        if self.available:
            self.job_error_logged = False
            self.printer_error_logged = False
        return response.json()
    except (requests.exceptions.ConnectionError, requests.exceptions.HTTPError, requests.exceptions.ReadTimeout) as conn_exc:
        log_string = ('Failed    to    update    OctoPrint    status.    ' + ('        Error:    %s' % conn_exc))
        if (endpoint == 'job'):
            log_string = ('Endpoint:    job    ' + log_string)
            if (not self.job_error_logged):
                _LOGGER.error(log_string)
                self.job_error_logged = True
                self.job_available = False
        elif (endpoint == 'printer'):
            log_string = ('Endpoint:    printer    ' + log_string)
            if (not self.printer_error_logged):
                _LOGGER.error(log_string)
                self.printer_error_logged = True
                self.printer_available = False
        self.available = False
        return None
