1
0
mirror of https://github.com/no2chem/wideq.git synced 2025-05-17 07:40:09 -07:00

Return None on monitoring when there's no code yet

This commit is contained in:
José Albornoz 2019-07-03 23:00:06 -04:00
parent 3411ba85e9
commit 4eb4ba1975

View File

@ -335,6 +335,10 @@ class Session(object):
work_list = [{'deviceId': device_id, 'workId': work_id}]
res = self.post('rti/rtiResult', {'workList': work_list})['workList']
# Return None in case work hasn't started yet
if not 'returnCode' in res:
return None
# Check for errors.
code = res.get('returnCode') # returnCode can be missing.
if code != '0000':