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
This commit is contained in:
andig 2021-11-18 11:37:14 +01:00 • committed by GitHub
parent 15a51a13a4
commit 9b16f9bcf2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 172 additions and 98 deletions

View file

@ -40,6 +40,15 @@ func (c ChargeStatus) String() string {
return string(c)
}
// ActionConfig defines an action to take on event
type ActionConfig struct {
Mode ChargeMode `mapstructure:"mode"` // Charge mode
MinCurrent float64 `mapstructure:"minCurrent"` // Minimum Current
MaxCurrent float64 `mapstructure:"maxCurrent"` // Maximum Current
MinSoC int `mapstructure:"minSoC"` // Minimum SoC
TargetSoC int `mapstructure:"targetSoC"` // Target SoC
}
// Meter is able to provide current power in W
type Meter interface {
CurrentPower() (float64, error)
@ -111,9 +120,10 @@ type Authorizer interface {
// Vehicle represents the EV and it's battery
type Vehicle interface {
Battery
Identifier
Title() string
Capacity() int64
Identifiers() []string
OnIdentified() ActionConfig
}
// VehicleFinishTimer provides estimated charge cycle finish time