Skip to content

Commit

Permalink
revert client timeout related change
Browse files Browse the repository at this point in the history
  • Loading branch information
GrimmiMeloni committed Jan 2, 2024
1 parent c33716e commit ff2f4ba
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions charger/easee.go
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ func NewEasee(user, password, charger string, timeout time.Duration, authorize b
obsTime: make(map[easee.ObservationID]time.Time),
}

c.Timeout = timeout
c.Client.Timeout = timeout

ts, err := easee.TokenSource(log, user, password)
if err != nil {
Expand Down Expand Up @@ -568,7 +568,7 @@ func (c *Easee) waitForTickResponse(expectedTick int64) error {
}
return nil
}
case <-time.After(c.Timeout):
case <-time.After(c.Client.Timeout):
return api.ErrTimeout
}
}
Expand All @@ -581,7 +581,7 @@ func (c *Easee) waitForChargerEnabledState(expEnabled bool) error {
return nil
}

timer := time.NewTimer(c.Timeout)
timer := time.NewTimer(c.Client.Timeout)
for {
select {
case obs := <-c.obsC:
Expand Down Expand Up @@ -610,7 +610,7 @@ func (c *Easee) waitForDynamicChargerCurrent(targetCurrent float64) error {
}
c.mux.Unlock()

timer := time.NewTimer(c.Timeout)
timer := time.NewTimer(c.Client.Timeout)
for {
select {
case obs := <-c.obsC:
Expand Down

0 comments on commit ff2f4ba

Please sign in to comment.