Skip to content

Commit

Permalink
Ocpp: assume RemoteTrigger feature available (#15632)
Browse files Browse the repository at this point in the history
  • Loading branch information
premultiply authored Aug 23, 2024
1 parent 3a49175 commit b6c1540
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion charger/ocpp.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ func NewOCPP(id string, connector int, idtag string,
meterValuesSampledData := ""
meterValuesSampledDataMaxLength := len(strings.Split(desiredMeasurands, ","))

c.hasRemoteTriggerFeature = true // assume remote trigger feature is available

err = ocpp.Instance().GetConfiguration(cp.ID(), func(resp *core.GetConfigurationConfirmation, err error) {
if err == nil {
for _, opt := range resp.ConfigurationKey {
Expand Down Expand Up @@ -234,7 +236,10 @@ func NewOCPP(id string, connector int, idtag string,
if !c.hasProperty(*opt.Value, smartcharging.ProfileName) {
c.log.WARN.Printf("the required SmartCharging feature profile is not indicated as supported")
}
c.hasRemoteTriggerFeature = c.hasProperty(*opt.Value, remotetrigger.ProfileName)
// correct the availability assumption of RemoteTrigger only in case of a valid looking FeatureProfile list
if c.hasProperty(*opt.Value, core.ProfileName) {
c.hasRemoteTriggerFeature = c.hasProperty(*opt.Value, remotetrigger.ProfileName)
}

// vendor-specific keys
case ocpp.KeyAlfenPlugAndChargeIdentifier:
Expand Down

0 comments on commit b6c1540

Please sign in to comment.