Skip to content

Commit

Permalink
Tibber: use energy instead of total as base if charges or taxes are d…
Browse files Browse the repository at this point in the history
…efined (evcc-io#9000)
  • Loading branch information
andig authored Jul 17, 2023
1 parent 66b32d8 commit 0493978
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tariff/tibber.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,10 +116,14 @@ func (t *Tibber) run(done chan error) {
func (t *Tibber) rates(pi []tibber.Price) api.Rates {
data := make(api.Rates, 0, len(pi))
for _, r := range pi {
price := r.Total
if t.Charges != 0 || t.Tax != 0 {
price = t.totalPrice(r.Energy)
}
ar := api.Rate{
Start: r.StartsAt.Local(),
End: r.StartsAt.Add(time.Hour).Local(),
Price: t.totalPrice(r.Total),
Price: price,
}
data = append(data, ar)
}
Expand Down

0 comments on commit 0493978

Please sign in to comment.