Return truethy when there are no data, but connection has been succeed

This commit is contained in:
2024-02-15 14:40:12 +01:00
parent e022f7b154
commit 493d4c2241

View File

@@ -201,7 +201,7 @@ class SensorDockApp(wmdocklib.DockApp):
if (self._data.get('_last_update') and
(now - self._data['_last_update']).seconds < 7500):
# don't hammer npb service to often
return
return True
for currency in self.conf.get('currencies'):
url = (f'http://api.nbp.pl/api/exchangerates/rates/a/{currency}/'
@@ -214,7 +214,7 @@ class SensorDockApp(wmdocklib.DockApp):
if response.status_code != 200:
print(f'error requesting data for currency "{currency} on '
f'time range between {start_date} and {end_date}')
return
return True
self._data['_last_update'] = now
result = response.json()