Ocpp: assume RemoteTrigger feature available (#15632)

This commit is contained in:
premultiply 2024-08-23 23:24:26 +02:00 • committed by GitHub
parent 3a4917536a
commit b6c1540477
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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 {
@ -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: