Powerwall: add Fleet API support (BC) (#32410)
This commit is contained in:
parent
28e41bdd09
commit
fdea008b0b
21 changed files with 548 additions and 200 deletions
|
|
@ -6,16 +6,16 @@ import (
|
|||
"github.com/AlecAivazis/survey/v2"
|
||||
"github.com/evcc-io/evcc/util"
|
||||
"github.com/evcc-io/evcc/util/config"
|
||||
"github.com/evcc-io/evcc/util/oauth"
|
||||
"github.com/evcc-io/evcc/util/request"
|
||||
"github.com/evcc-io/evcc/vehicle"
|
||||
"github.com/evcc-io/evcc/vehicle/ford/connect"
|
||||
"golang.org/x/oauth2"
|
||||
)
|
||||
|
||||
func fordConnectToken(conf config.Named) (*oauth2.Token, error) {
|
||||
var cc struct {
|
||||
Credentials vehicle.ClientCredentials
|
||||
Tokens vehicle.Tokens
|
||||
Credentials oauth.ClientCredentials
|
||||
Tokens oauth.Tokens
|
||||
Other map[string]any `mapstructure:",remain"`
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ import (
|
|||
"github.com/evcc-io/evcc/api/globalconfig"
|
||||
"github.com/evcc-io/evcc/util"
|
||||
"github.com/evcc-io/evcc/util/config"
|
||||
"github.com/evcc-io/evcc/vehicle"
|
||||
"github.com/evcc-io/evcc/util/oauth"
|
||||
"github.com/evcc-io/evcc/vehicle/tronity"
|
||||
"github.com/samber/lo"
|
||||
"github.com/skratchdot/open-golang/open"
|
||||
|
|
@ -101,7 +101,7 @@ func tronityAuthorize(addr string, oc *oauth2.Config) (*oauth2.Token, error) {
|
|||
|
||||
func tronityToken(conf globalconfig.All, vehicleConf config.Named) (*oauth2.Token, error) {
|
||||
var cc struct {
|
||||
Credentials vehicle.ClientCredentials
|
||||
Credentials oauth.ClientCredentials
|
||||
RedirectURI string
|
||||
Other map[string]any `mapstructure:",remain"`
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue