Skip to content

bugs in get_idle_periods, with suggested fixes #122

@kapet

Description

@kapet

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions