Skip to content

Commit 8b4b3d6

Browse files
committed
fix(tempo): hotfix the API calls to retrieve the color by adding a user agent
1 parent e7ccf54 commit 8b4b3d6

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

custom_components/tarif_edf/coordinator.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,13 @@
3333
_LOGGER = logging.getLogger(__name__)
3434

3535
def get_remote_file(url: str):
36-
response = requests.get(url, stream = True)
37-
return response
36+
return requests.get(
37+
url,
38+
stream=True,
39+
headers={
40+
"User-Agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36"
41+
},
42+
)
3843

3944
def str_to_time(str):
4045
return datetime.strptime(str, '%H:%M').time()

0 commit comments

Comments
 (0)