Skip to content

Commit be466d8

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 7aa833a + 6d7b8bb commit be466d8

File tree

257 files changed

+5944
-3714
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

257 files changed

+5944
-3714
lines changed

.eslintrc.cjs

-24
This file was deleted.

.goreleaser.yml

+4
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ builds:
3232
goarch: arm
3333
- goos: windows
3434
goarch: arm64
35+
overrides:
36+
- goos: darwin
37+
ldflags:
38+
- "-B gobuildid"
3539

3640
env:
3741
- CGO_ENABLED=0

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ build::
7777
CGO_ENABLED=0 go build -v $(BUILD_TAGS) $(BUILD_ARGS)
7878

7979
snapshot::
80-
goreleaser --snapshot --skip-publish --clean
80+
goreleaser --snapshot --skip publish --clean
8181

8282
release::
8383
goreleaser --clean

api/api.go

+7-2
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ type CurrentGetter interface {
6868
GetMaxCurrent() (float64, error)
6969
}
7070

71-
// BatteryController optionally allows to control home battery (dis)charging behaviour
71+
// BatteryController optionally allows to control home battery (dis)charging behavior
7272
type BatteryController interface {
7373
SetBatteryMode(BatteryMode) error
7474
}
@@ -120,7 +120,7 @@ type Authorizer interface {
120120
Authorize(key string) error
121121
}
122122

123-
// PhaseDescriber returns the number of availablephases
123+
// PhaseDescriber returns the number of available phases
124124
type PhaseDescriber interface {
125125
Phases() int
126126
}
@@ -241,3 +241,8 @@ type Circuit interface {
241241
ValidateCurrent(old, new float64) float64
242242
ValidatePower(old, new float64) float64
243243
}
244+
245+
// Redactor is an interface to redact sensitive data
246+
type Redactor interface {
247+
Redacted() any
248+
}

api/globalconfig/types.go

+19-4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import (
66
"strconv"
77
"time"
88

9+
"github.com/evcc-io/evcc/api"
910
"github.com/evcc-io/evcc/provider/mqtt"
1011
"github.com/evcc-io/evcc/push"
1112
"github.com/evcc-io/evcc/server/eebus"
@@ -30,7 +31,7 @@ type All struct {
3031
Go []Go
3132
Influx Influx
3233
EEBus eebus.Config
33-
HEMS config.Typed
34+
HEMS Hems
3435
Messaging Messaging
3536
Meters []config.Named
3637
Chargers []config.Named
@@ -57,6 +58,20 @@ type ModbusProxy struct {
5758
modbus.Settings `mapstructure:",squash"`
5859
}
5960

61+
var _ api.Redactor = (*Hems)(nil)
62+
63+
type Hems config.Typed
64+
65+
func (c Hems) Redacted() any {
66+
return struct {
67+
Type string `json:"type,omitempty"`
68+
}{
69+
Type: c.Type,
70+
}
71+
}
72+
73+
var _ api.Redactor = (*Mqtt)(nil)
74+
6075
type Mqtt struct {
6176
mqtt.Config `mapstructure:",squash"`
6277
Topic string `json:"topic"`
@@ -68,9 +83,9 @@ func (m Mqtt) Redacted() any {
6883
return struct {
6984
Broker string `json:"broker"`
7085
Topic string `json:"topic"`
71-
User string `json:"user"`
72-
ClientID string `json:"clientID"`
73-
Insecure bool `json:"insecure"`
86+
User string `json:"user,omitempty"`
87+
ClientID string `json:"clientID,omitempty"`
88+
Insecure bool `json:"insecure,omitempty"`
7489
}{
7590
Broker: m.Broker,
7691
Topic: m.Topic,

api/mock.go

+44-28
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)