Ocpp: Alfen: override idtag with plug&charge setting (#5021)
This commit is contained in:
parent
8db2d1b5a0
commit
24f49585b9
2 changed files with 12 additions and 1 deletions
|
|
@ -32,6 +32,8 @@ type OCPP struct {
|
|||
phaseSwitching bool
|
||||
}
|
||||
|
||||
const defaultIdTag = "evcc"
|
||||
|
||||
func init() {
|
||||
registry.Add("ocpp", NewOCPPFromConfig)
|
||||
}
|
||||
|
|
@ -50,7 +52,7 @@ func NewOCPPFromConfig(other map[string]interface{}) (api.Charger, error) {
|
|||
Timeout time.Duration
|
||||
}{
|
||||
Connector: 1,
|
||||
IdTag: "evcc",
|
||||
IdTag: defaultIdTag,
|
||||
Timeout: time.Minute,
|
||||
}
|
||||
|
||||
|
|
@ -192,6 +194,12 @@ func NewOCPP(id string, connector int, idtag string, meterValues string, meterIn
|
|||
if val, err = strconv.ParseBool(*opt.Value); err == nil {
|
||||
c.phaseSwitching = val
|
||||
}
|
||||
|
||||
case ocpp.KeyAlfenPlugAndChargeIdentifier:
|
||||
if c.idtag == defaultIdTag {
|
||||
c.idtag = *opt.Value
|
||||
c.log.DEBUG.Printf("overriding default `idTag` with Alfen-specific value: %s", c.idtag)
|
||||
}
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -27,6 +27,9 @@ const (
|
|||
KeyChargingScheduleMaxPeriods = "ChargingScheduleMaxPeriods"
|
||||
KeyConnectorSwitch3to1PhaseSupported = "ConnectorSwitch3to1PhaseSupported"
|
||||
KeyMaxChargingProfilesInstalled = "MaxChargingProfilesInstalled"
|
||||
|
||||
// Alfen specific keys
|
||||
KeyAlfenPlugAndChargeIdentifier = "PlugAndChargeIdentifier"
|
||||
)
|
||||
|
||||
type CP struct {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue