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:
parent
15a51a13a4
commit
9b16f9bcf2
10 changed files with 172 additions and 98 deletions
12
api/api.go
12
api/api.go
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue