Skip to content

Commit

Permalink
Renault: add timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Aug 29, 2022
1 parent 753a4da commit 8c7db5b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions vehicle/renault.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (

"github.com/evcc-io/evcc/api"
"github.com/evcc-io/evcc/util"
"github.com/evcc-io/evcc/util/request"
"github.com/evcc-io/evcc/vehicle/renault"
"github.com/evcc-io/evcc/vehicle/renault/gigya"
"github.com/evcc-io/evcc/vehicle/renault/kamereon"
Expand Down Expand Up @@ -39,9 +40,11 @@ func NewRenaultDaciaFromConfig(brand string, other map[string]interface{}) (api.
embed `mapstructure:",squash"`
User, Password, Region, VIN string
Cache time.Duration
Timeout time.Duration
}{
Region: "de_DE",
Cache: interval,
Region: "de_DE",
Cache: interval,
Timeout: request.Timeout,
}

if err := util.DecodeOther(other, &cc); err != nil {
Expand All @@ -65,6 +68,7 @@ func NewRenaultDaciaFromConfig(brand string, other map[string]interface{}) (api.
api := kamereon.New(log, keys.Kamereon, identity, func() error {
return identity.Login(cc.User, cc.Password)
})
api.Client.Timeout = cc.Timeout

accountID, err := api.Person(identity.PersonID, brand)

Expand Down

0 comments on commit 8c7db5b

Please sign in to comment.