Skip to content

Commit

Permalink
chore: minor
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Sep 8, 2024
1 parent d3f9ca3 commit 515d864
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions charger/eebus.go
Original file line number Diff line number Diff line change
Expand Up @@ -580,8 +580,7 @@ func (c *EEBus) currents() (float64, float64, float64, error) {
// if there is no measurement data available within 15 seconds after the last limit change, return an error
// only consider it an error, if there is no measurement data since 15 seconds after the last limit change
// a measurement only being available before the last limit change is not an error, because that can happen often
d := ts.Sub(c.limitUpdated)
if !c.limitUpdated.IsZero() && (d > 15*time.Second) {
if d := ts.Sub(c.limitUpdated); d > 15*time.Second && !c.limitUpdated.IsZero() {
return 0, 0, 0, api.ErrNotAvailable
}

Expand Down

0 comments on commit 515d864

Please sign in to comment.