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:
parent
3411ba85e9
commit
4eb4ba1975
@ -335,6 +335,10 @@ class Session(object):
|
|||||||
work_list = [{'deviceId': device_id, 'workId': work_id}]
|
work_list = [{'deviceId': device_id, 'workId': work_id}]
|
||||||
res = self.post('rti/rtiResult', {'workList': work_list})['workList']
|
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.
|
# Check for errors.
|
||||||
code = res.get('returnCode') # returnCode can be missing.
|
code = res.get('returnCode') # returnCode can be missing.
|
||||||
if code != '0000':
|
if code != '0000':
|
||||||
|
Loading…
x
Reference in New Issue
Block a user