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:
@@ -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']]
|
||||
|
||||
Reference in New Issue
Block a user