evcc-io/vehicle/embed.go
andig 9b16f9bcf2
Improve vehicle identification experience (#1889)
- allow multiple identifiers per vehicle to support RFID and MAC across multiple chargers
- move onIdentify action config from loadpoint to vehicle
- add minSoC to action config
- replace onDisconnect with simpler resetOnDisconnect
2021-11-18 11:37:14 +01:00

30 lines
753 B
Go

package vehicle
import "github.com/evcc-io/evcc/api"
type embed struct {
Title_ string `mapstructure:"title"`
Capacity_ int64 `mapstructure:"capacity"`
Identifiers_ []string `mapstructure:"identifiers"`
OnIdentify api.ActionConfig `mapstructure:"onIdentify"`
}
// Title implements the api.Vehicle interface
func (v *embed) Title() string {
return v.Title_
}
// Capacity implements the api.Vehicle interface
func (v *embed) Capacity() int64 {
return v.Capacity_
}
// Identifiers implements the api.Identifier interface
func (v *embed) Identifiers() []string {
return v.Identifiers_
}
// OnIdentified returns the identify action
func (v *embed) OnIdentified() api.ActionConfig {
return v.OnIdentify
}