lorenzodonini / ocpp-go

Open Charge Point Protocol implementation in Go
MIT License
277 stars 126 forks source link

Fix validation for connectorId of GetCompositeSchedule.conf #275

Closed initialed85 closed 5 months ago

initialed85 commented 6 months ago

Hi,

This lib is awesome, we've built a production OCPP server around it and it's going great!

This PR fixes the validation of the connectorId field of GetCompositeSchedule.conf (https://github.com/lorenzodonini/ocpp-go/issues/276); I believe this fix is in keeping w/ OCPP 1.6:

image

An excerpt re: GetCompositeSchedule:

If the ConnectorId in the request is set to '0', the Charge Point SHALL report the total expected power or current the Charge Point expects to consume from the grid during the requested time period.

While I was in the code I also ran go fmt and tidied up a couple of (probably unimportant) go vet failures around copied locks in test code.

lorenzodonini commented 5 months ago

Hey, sorry for the late review and thanks a lot for the contribution! Approved & merged

initialed85 commented 4 months ago

Hey, sorry for the late review and thanks a lot for the contribution! Approved & merged

Thx @lorenzodonini!