fsantini / python-e3dc

Python API for querying E3/DC systems through the manufacturer's portal
MIT License
71 stars 23 forks source link

Update list of tags and move to enum #87

Closed eikowagenknecht closed 8 months ago

eikowagenknecht commented 9 months ago

Implements #85

Moving to Enum instead of loose string references has the advantage that now only existing tags can be used and the IDE picks up on errors.

Unfortunately since "BAT_REQ_MEASURED_RESISTANCE" (0x03000130) and "BAT_RUN_MEASURED_RESISTANCE" (0x03800131) don't exist any more, I had to remove those two from the output.

But I think this is a good thing because those two were wrong anyways (see values in screenshots):

I can add those avg30s values to the battery results if you want. Currently those only exist on DCB level.

image

vchrisb commented 9 months ago

Thank you @eikowagenknecht! 🥇 That is a lot of change. Can you please separate the two commits into two PRs?

eikowagenknecht commented 9 months ago

Ooops, I intended to do so. The other PR should be fine, but this one needs to be rebased against master. On it.

eikowagenknecht commented 9 months ago

Done. I also fixed the flake8 errors.

eikowagenknecht commented 9 months ago

Fixed the remaining two flake8 errors..

eikowagenknecht commented 9 months ago

Ran isort and black as well now...

vchrisb commented 8 months ago

@eikowagenknecht do you potentially already created a script how you generated the RscpTag? I think it would be valuable to add this somewhere to make future updates easier.

vchrisb commented 8 months ago
eikowagenknecht commented 8 months ago

@eikowagenknecht do you potentially already created a script how you generated the RscpTag? I think it would be valuable to add this somewhere to make future updates easier.

Sure, I commented and added the script. I put it into a newly created tools directory, if you want it somewhere else I'm happy to move it.

eikowagenknecht commented 8 months ago
  • would you mind moving rscpErrorCodes and powermeterTypes also to enum?
  • may I suggest using rscptype instead of type_?

All done.

eikowagenknecht commented 8 months ago

Seems like flake8-docstrings is used as well in the GitHub workflow. I added that requirement to the developer section of the readme.

fsantini commented 8 months ago

Congratulations :)