SmartEnergy: use hour slots

This commit is contained in:
andig 2025-02-25 08:06:01 +01:00
parent 30ab9a45cc
commit 268cb9c974

View file

@ -68,9 +68,13 @@ func (t *SmartEnergy) run(done chan error) {
data := make(api.Rates, 0, len(res.Data))
for _, r := range res.Data {
if r.Date.Minute() != 0 {
continue
}
ar := api.Rate{
Start: r.Date.Local(),
End: r.Date.Add(15 * time.Minute).Local(),
End: r.Date.Add(time.Hour).Local(),
Price: t.totalPrice(r.Value/100, r.Date),
}
data = append(data, ar)