Skip to content

Commit

Permalink
Powerwall: move log redaction of siteId until after determined (evcc-…
Browse files Browse the repository at this point in the history
  • Loading branch information
GrimmiMeloni authored Nov 22, 2023
1 parent 419074f commit 519b8df
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion meter/powerwall.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func NewPowerWallFromConfig(other map[string]interface{}) (api.Meter, error) {

// NewPowerWall creates a Tesla PowerWall Meter
func NewPowerWall(uri, usage, user, password string, cache time.Duration, refreshToken string, siteId int64, battery battery) (api.Meter, error) {
log := util.NewLogger("powerwall").Redact(user, password, refreshToken, strconv.FormatInt(siteId, 10))
log := util.NewLogger("powerwall").Redact(user, password, refreshToken)

httpClient := &http.Client{
Transport: request.NewTripper(log, powerwall.DefaultTransport()),
Expand Down Expand Up @@ -129,6 +129,7 @@ func NewPowerWall(uri, usage, user, password string, cache time.Duration, refres
}
}

log.Redact(strconv.FormatInt(siteId, 10))
energySite, err := cloudClient.EnergySite(siteId)
if err != nil {
return nil, err
Expand Down

0 comments on commit 519b8df

Please sign in to comment.