tronikos / opower-hacs

HACS integration for PG&E via Opower
10 stars 2 forks source link

KeyError: costToDate #3

Closed Asherlc closed 1 year ago

Asherlc commented 1 year ago

See below for an error I'm getting, looks like whatever response PGE is sending isn't including some expected fields?

This error originated from a custom integration.

Logger: custom_components.opower.coordinator
Source: custom_components/opower/coordinator.py:67
Integration: Opower (documentation, issues)
First occurred: 5:01:21 PM (7 occurrences)
Last logged: 5:05:51 PM

Unexpected error fetching Opower data: 'costToDate'
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 250, in _async_refresh
    self.data = await self._async_update_data()
  File "/config/custom_components/opower/coordinator.py", line 67, in _async_update_data
    forecasts = await self.api.async_get_forecast()
  File "/usr/local/lib/python3.10/site-packages/opower/opower.py", line 223, in async_get_forecast
    cost_to_date=float(forecast["costToDate"]),
KeyError: 'costToDate'
ampersandru commented 1 year ago

another user mentioned this error and he stated it fixed itself and started working after a few minutes. Has yours started working?

Asherlc commented 1 year ago

Mine has been going for a few hours or so and no luck unfortunately

tronikos commented 1 year ago

Please update to v0.0.4. Reopen if it didn't fix your issue.