The component does not gracefully handle missing data from OVO. Previously I noticed the HA integration error when consumption data was missing, currently it is erroring because the meter readings are missing. Whilst I would expect an error to be logged, ideally we shouldn't get a stack trace as well. Being perfect, it should produce one error and then no more until the problem is resolved by OVO when it should return a resolved type information message.
How to reproduce the issue (if applicable)
Run the integration now, OVO may resolve the issue soon :-)
Screenshots (if applicable)
Error log
2021-04-23 08:59:17 ERROR (MainThread) [homeassistant.components.ovo_energy] Unexpected error fetching sensor data: 'meterReadings'
Traceback (most recent call last):
File "/workspaces/home-assistant/homeassistant/helpers/update_coordinator.py", line 180, in _async_refresh
self.data = await self._async_update_data()
File "/workspaces/home-assistant/homeassistant/helpers/update_coordinator.py", line 140, in _async_update_data
return await self.update_method()
File "/workspaces/home-assistant/homeassistant/components/ovo_energy/__init__.py", line 55, in async_update_data
return await client.get_daily_usage(datetime.utcnow().strftime("%Y-%m"))
File "/usr/local/lib/python3.8/site-packages/ovoenergy/ovoenergy.py", line 100, in get_daily_usage
usage["meterReadings"]["start"],
KeyError: 'meterReadings'
Description
The component does not gracefully handle missing data from OVO. Previously I noticed the HA integration error when consumption data was missing, currently it is erroring because the meter readings are missing. Whilst I would expect an error to be logged, ideally we shouldn't get a stack trace as well. Being perfect, it should produce one error and then no more until the problem is resolved by OVO when it should return a resolved type information message.
How to reproduce the issue (if applicable)
Run the integration now, OVO may resolve the issue soon :-)
Screenshots (if applicable)
Error log
Postman extract
Additional information