Fix mix of aiohttp and requests in Bloomsky (#74598)

This commit is contained in:
Franck Nijhof 2022-07-07 12:27:25 +02:00 committed by GitHub
parent ba7ad1029c
commit 19f33d205c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,7 +3,6 @@ from datetime import timedelta
from http import HTTPStatus from http import HTTPStatus
import logging import logging
from aiohttp.hdrs import AUTHORIZATION
import requests import requests
import voluptuous as vol import voluptuous as vol
@ -67,7 +66,7 @@ class BloomSky:
_LOGGER.debug("Fetching BloomSky update") _LOGGER.debug("Fetching BloomSky update")
response = requests.get( response = requests.get(
f"{self.API_URL}?{self._endpoint_argument}", f"{self.API_URL}?{self._endpoint_argument}",
headers={AUTHORIZATION: self._api_key}, headers={"Authorization": self._api_key},
timeout=10, timeout=10,
) )
if response.status_code == HTTPStatus.UNAUTHORIZED: if response.status_code == HTTPStatus.UNAUTHORIZED: