Skip to content

Commit

Permalink
Dadapower: require sponsorship (BC)
Browse files Browse the repository at this point in the history
  • Loading branch information
andig committed Sep 1, 2024
1 parent 5ad1ec9 commit 3c359fc
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions charger/dadapower.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"github.com/evcc-io/evcc/api"
"github.com/evcc-io/evcc/util"
"github.com/evcc-io/evcc/util/modbus"
"github.com/evcc-io/evcc/util/sponsor"
)

const (
Expand Down Expand Up @@ -57,6 +58,10 @@ func NewDadapower(uri string, id uint8) (*Dadapower, error) {
return nil, err
}

if !sponsor.IsAuthorized() {
return nil, api.ErrSponsorRequired
}

log := util.NewLogger("dadapower")
conn.Logger(log.TRACE)

Expand Down

0 comments on commit 3c359fc

Please sign in to comment.