Add battery grid charging (#14855)
This commit is contained in:
parent
bbf989c3c0
commit
b0ea0582e2
37 changed files with 797 additions and 489 deletions
|
|
@ -31,7 +31,7 @@ func (r Rates) Sort() {
|
|||
// Current returns the rates current rate or error
|
||||
func (r Rates) Current(now time.Time) (Rate, error) {
|
||||
for _, rr := range r {
|
||||
if (rr.Start.Before(now) || rr.Start.Equal(now)) && rr.End.After(now) {
|
||||
if !rr.Start.After(now) && rr.End.After(now) {
|
||||
return rr, nil
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue