GuyKh / iec-custom-component

HomeAssistant Custom Component for IEC
MIT License
112 stars 3 forks source link

When users just installed meters, trying to fetch data from 1 month back would fail #128

Open GuyKh opened 1 week ago

GuyKh commented 1 week ago

System Health details

N/A

Checklist

Describe the issue

When users just installed meters, trying to fetch data from 1 month back would fail since the data is more recent.

Reproduction steps

1.Install a new smart_meter 2.install the component without a month passing 3.Check for iec: in energy dashboard ...

Debug logs

N/A

Diagnostics dump

No response

GuyKh commented 1 week ago

Per @maorcc report

GuyKh commented 1 week ago

One optional solution would be to have the time to fetch if no recent statistics to be customizable in the config_flow rather than hardcoded 4 weeks (https://github.com/GuyKh/iec-custom-component/blob/main/custom_components/iec/coordinator.py#L355)