Add basic OCPP support (#395)
This commit is contained in:
parent
9bd8754b85
commit
29ea3c6549
20 changed files with 618 additions and 130 deletions
|
|
@ -20,7 +20,7 @@ type config struct {
|
|||
Interval time.Duration
|
||||
Mqtt provider.MqttConfig
|
||||
Influx server.InfluxConfig
|
||||
HEMS string
|
||||
HEMS typedConfig
|
||||
Messaging messagingConfig
|
||||
Meters []qualifiedConfig
|
||||
Chargers []qualifiedConfig
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ func run(cmd *cobra.Command, args []string) {
|
|||
httpd := server.NewHTTPd(uri, site, socketHub, cache)
|
||||
|
||||
// start HEMS server
|
||||
if conf.HEMS != "" {
|
||||
if conf.HEMS.Type != "" {
|
||||
hems := configureHEMS(conf.HEMS, site, cache, httpd)
|
||||
go hems.Run()
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,8 +52,8 @@ func configureMQTT(conf provider.MqttConfig) {
|
|||
}
|
||||
|
||||
// setup HEMS
|
||||
func configureHEMS(conf string, site *core.Site, cache *util.Cache, httpd *server.HTTPd) hems.HEMS {
|
||||
hems, err := hems.NewFromConfig(conf, site, cache, httpd)
|
||||
func configureHEMS(conf typedConfig, site *core.Site, cache *util.Cache, httpd *server.HTTPd) hems.HEMS {
|
||||
hems, err := hems.NewFromConfig(conf.Type, conf.Other, site, cache, httpd)
|
||||
if err != nil {
|
||||
log.FATAL.Fatalf("failed configuring hems: %v", err)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue