python-e3dc
python-e3dc copied to clipboard
bugs in get_idle_periods, with suggested fixes
Sorry for not sending a PR, not working on a computer set up for git etc.
-
_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:
-
_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!