1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 12:59:34 +00:00

Fix bug when IQVIA API fails to return data (#23916)

* Fix bug when IQVIA API fails to return data

* Updated requirements

* Fixed tests

* Linting

* Removed impossible case

* Removed extraneous comment
This commit is contained in:
Aaron Bach
2019-05-16 15:19:53 -06:00
committed by GitHub
parent c8cf06b8b7
commit 297d24c5b0
7 changed files with 13 additions and 33 deletions

View File

@@ -106,8 +106,8 @@ class ForecastSensor(IQVIAEntity):
if not self._iqvia.data:
return
data = self._iqvia.data[self._type].get('Location')
if not data:
data = self._iqvia.data[self._type]['Location']
if not data.get('periods'):
return
indices = [p['Index'] for p in data['periods']]