You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
When starting HA, the following error log appears:
Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/homeassistant_historical_sensor/sensor.py", line 155, in async_write_ha_historical_states
await self._async_save_states_into_statistics(hist_states)
File "/usr/local/lib/python3.10/site-packages/homeassistant_historical_sensor/sensor.py", line 203, in _async_save_states_into_statistics
statistics_data = await self.async_calculate_statistic_data(
File "/config/custom_components/ideenergy/sensor.py", line 107, in async_calculate_statistic_data
hist_states = [x for x in hist_states if x.when >= latest["end"]]
File "/config/custom_components/ideenergy/sensor.py", line 107, in <listcomp>
hist_states = [x for x in hist_states if x.when >= latest["end"]]
AttributeError: 'HistoricalState' object has no attribute 'when'
To Reproduce
I had wip/historical-sensor branch running. It stopped working when I updated HA to 2023.3.X due to changes in DB.
As mentioned in Request for testing #34, I pulled the main branch, changed the HISTORICAL_PERIOD_LENGHT constant to timedelta(days=15), and restarted everything.
Environment
HomeAssistant version: 2023.3.4
ideenergy integration version: main branch, commit 288ab92
Expected behavior
After restarting HA, I expected the integration to download past consumption data and import it into Energy dashboard.
Logs
Working on it to avoid leaking data
Screenshots
N/A
Additional context
Like said, I came from wip/historical-sensor branch due to #34. I have 2 contracts, one is "disabled" but it has never been an issue before.
The text was updated successfully, but these errors were encountered:
Describe the bug
When starting HA, the following error log appears:
To Reproduce
wip/historical-sensor
branch running. It stopped working when I updated HA to 2023.3.X due to changes in DB.main
branch, changed theHISTORICAL_PERIOD_LENGHT
constant totimedelta(days=15)
, and restarted everything.Environment
main
branch, commit288ab92
Expected behavior
After restarting HA, I expected the integration to download past consumption data and import it into Energy dashboard.
Logs
Working on it to avoid leaking data
Screenshots
N/A
Additional context
Like said, I came from
wip/historical-sensor
branch due to #34. I have 2 contracts, one is "disabled" but it has never been an issue before.The text was updated successfully, but these errors were encountered: