try to change blank errno to handle life span if type detected
catch if no td in result
This commit is contained in:
@@ -980,19 +980,23 @@ class EcoVacsXMPP(ClientXMPP):
|
|||||||
return result
|
return result
|
||||||
|
|
||||||
elif 'type' in result:
|
elif 'type' in result:
|
||||||
result['event'] = result.pop('type')
|
# result['event'] = result.pop('type')
|
||||||
if xml:
|
if 'errno' in result:
|
||||||
result.update(xml[0].attrib)
|
if result['errno'] = '':
|
||||||
|
result['errno'] = 'handle_life_span'
|
||||||
|
result['event'] = result.pop('errno')
|
||||||
|
if xml:
|
||||||
|
result.update(xml[0].attrib)
|
||||||
|
|
||||||
for key in result:
|
for key in result:
|
||||||
if not RepresentsInt(result[key]): #Fix to handle negative int values
|
if not RepresentsInt(result[key]): #Fix to handle negative int values
|
||||||
result[key] = stringcase.snakecase(result[key])
|
result[key] = stringcase.snakecase(result[key])
|
||||||
|
|
||||||
_LOGGER.debug("type detected in result and result is:")
|
_LOGGER.debug("type detected in result and result is:")
|
||||||
_LOGGER.debug(result)
|
_LOGGER.debug(result)
|
||||||
_LOGGER.debug("end of type detect result")
|
_LOGGER.debug("end of type detect result")
|
||||||
|
|
||||||
return result
|
return result
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# This happens for commands with no response data, such as PlaySound
|
# This happens for commands with no response data, such as PlaySound
|
||||||
|
|||||||
Reference in New Issue
Block a user