Skip to content

Commit 301e880

Browse files
darashenkafabaff
authored andcommitted
Fix bugs in hassio, because luftdaten.info do not always answer within 5 sec. fix home-assistant/core#25342 home-assistant/core#25159 (#6)
1 parent 3c38c79 commit 301e880

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

luftdaten/__init__.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,11 @@ def __init__(self, sensor_id, loop, session):
2727
async def get_data(self):
2828
"""Retrieve the data."""
2929
try:
30-
with async_timeout.timeout(5, loop=self._loop):
31-
response = await self._session.get(
32-
'{}/{}/'.format(self.url, self.sensor_id))
30+
url = '{}/{}/'.format(self.url, self.sensor_id)
31+
_LOGGER.debug(
32+
"Requesting luftdaten.info: %s", url)
33+
with async_timeout.timeout(60, loop=self._loop):
34+
response = await self._session.get(url)
3335

3436
_LOGGER.debug(
3537
"Response from luftdaten.info: %s", response.status)

0 commit comments

Comments
 (0)