OCPP UI: improve setup flow (#24453)
Co-authored-by: andig <andi@evcc.io>
This commit is contained in:
parent
b4a0d2d0a0
commit
117963dcb5
50 changed files with 1319 additions and 103 deletions
14
cmd/setup.go
14
cmd/setup.go
|
|
@ -17,6 +17,7 @@ import (
|
|||
"github.com/evcc-io/evcc/api"
|
||||
"github.com/evcc-io/evcc/api/globalconfig"
|
||||
"github.com/evcc-io/evcc/charger"
|
||||
"github.com/evcc-io/evcc/charger/ocpp"
|
||||
"github.com/evcc-io/evcc/cmd/shutdown"
|
||||
"github.com/evcc-io/evcc/core"
|
||||
"github.com/evcc-io/evcc/core/circuit"
|
||||
|
|
@ -65,6 +66,9 @@ var conf = globalconfig.All{
|
|||
Host: "",
|
||||
Port: 7070,
|
||||
},
|
||||
Ocpp: ocpp.Config{
|
||||
Port: 8887,
|
||||
},
|
||||
Mqtt: globalconfig.Mqtt{
|
||||
Topic: "evcc",
|
||||
},
|
||||
|
|
@ -547,6 +551,11 @@ func configureEnvironment(cmd *cobra.Command, conf *globalconfig.All) error {
|
|||
err = wrapErrorWithClass(ClassMqtt, configureMqtt(&conf.Mqtt))
|
||||
}
|
||||
|
||||
// setup OCPP server
|
||||
if err == nil {
|
||||
configureOCPP(&conf.Ocpp, conf.Network.ExternalUrl)
|
||||
}
|
||||
|
||||
// setup EEBus server
|
||||
if err == nil {
|
||||
err = wrapErrorWithClass(ClassEEBus, configureEEBus(&conf.EEBus))
|
||||
|
|
@ -758,6 +767,11 @@ func configureMDNS(conf globalconfig.Network) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
// setup OCPP
|
||||
func configureOCPP(cfg *ocpp.Config, externalUrl string) {
|
||||
ocpp.Init(*cfg, externalUrl)
|
||||
}
|
||||
|
||||
// setup EEBus
|
||||
func configureEEBus(conf *eebus.Config) error {
|
||||
// migrate settings
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue