SmartEnergy: use hour slots
This commit is contained in:
parent
30ab9a45cc
commit
268cb9c974
1 changed files with 5 additions and 1 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue