Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions e3dc/_e3dc.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,20 @@ def get_idle_periods(self, keepAlive: bool = False):
(RscpTag.EMS_REQ_GET_IDLE_PERIODS, RscpType.NoneType, None),
keepAlive=keepAlive,
)
if idlePeriodsRaw[0] != RscpTag.EMS_GET_IDLE_PERIODS:

raw = idlePeriodsRaw[0]

if isinstance(raw, RscpTag):
tag = raw
elif isinstance(raw, str):
try:
tag = RscpTag[raw]
except KeyError:
return None
else:
return None

if tag != RscpTag.EMS_GET_IDLE_PERIODS:
return None

idlePeriods: dict[str, list[dict[str, Any]]] = {
Expand Down Expand Up @@ -664,8 +677,8 @@ def set_idle_periods(
else:
raise TypeError("period in " + idle_type + " is not a dict")

else:
raise TypeError(idle_type + " is not a dict")
else:
raise TypeError(idle_type + " is not a dict")

result = self.sendRequest(
(RscpTag.EMS_REQ_SET_IDLE_PERIODS, RscpType.Container, periodList),
Expand Down