mirror of
https://github.com/jdejaegh/irm-kmi-ha.git
synced 2025-06-27 03:35:56 +02:00
Add User-Agent to the client
This commit is contained in:
parent
e4a6d254af
commit
35bc326267
1 changed files with 4 additions and 0 deletions
|
@ -69,6 +69,10 @@ class IrmKmiApiClient:
|
|||
headers: dict | None = None,
|
||||
) -> any:
|
||||
"""Get information from the API."""
|
||||
if headers is None:
|
||||
headers = {'User-Agent': 'github.com/jdejaegh/irm-kmi-ha'}
|
||||
else:
|
||||
headers['User-Agent'] = 'github.com/jdejaegh/irm-kmi-ha'
|
||||
|
||||
try:
|
||||
async with async_timeout.timeout(60):
|
||||
|
|
Loading…
Add table
Reference in a new issue