lorenzodonini / ocpp-go

Open Charge Point Protocol implementation in Go
MIT License
262 stars 125 forks source link

Add dateparse and DefaultTimeFormat #34

Open Houtmann opened 3 years ago

Houtmann commented 3 years ago

I dot this pull request because in reality when you write an OCPP central system server, you may have more than one brand of chargepoint on the same central system. For example in my company, we have 4 brands of chargepoint connect on the server. And in fact chargepoint's brands do not meet the standards DateTime.

The library dateparse allows us to deal with this problem;

lorenzodonini commented 3 years ago

Hey Had, you make a good point there.

I originally thought of keeping the included batteries to a minimum and enforce the specifications, which clearly say that:

Imho charge point vendors should conform to these standards, however it makes sense to provide some flexibility for devs.

It would be really nice, if you could add the same change for the ocpp2.0/types package directly (the code is basically the same).

Houtmann commented 3 years ago

All right, I'll do that. As I said, 4 different brands, 4 different date formats...

lorenzodonini commented 3 years ago

Just checked out your branch and ran the unit tests. Some of them are now failing, apparently because the datetime equality checks are not passing.

Can you make look into it and figure out why? Otherwise I'll do it as soon as I have some time.

Houtmann commented 3 years ago

Yes I'll look into the problem