Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugs in get_idle_periods, with suggested fixes #122

Open
kapet opened this issue Oct 5, 2024 · 0 comments
Open

bugs in get_idle_periods, with suggested fixes #122

kapet opened this issue Oct 5, 2024 · 0 comments

Comments

@kapet
Copy link

kapet commented Oct 5, 2024

Sorry for not sending a PR, not working on a computer set up for git etc.

  1. _e3dc.py line 462:
    if idlePeriodsRaw[0] != RscpTag.EMS_GET_IDLE_PERIODS:
    Looks like the first value in idlePeriodsRaw can be a string, not just the enum. This breaks the code even when the device replies correctly.
    This works and should catch all variations:
    if getRscpTag(idlePeriodsRaw[0]) != RscpTag.EMS_GET_IDLE_PERIODS:

  2. _e3dc.py lines 466-467:
    "idleCharge": [] * 7, "idleDischarge": [] * 7,
    This can not work, []*7 is still just []. You need something in there to create a list of that size, e.g.: [None] * 7
    Without this the assignments on lines 489/491 always throw exceptions.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant