You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sometimes I got a Phython-error in the log on line: self.plantId = apiResponse["back"]["data"][0]["plantId"]
the cause was: the apiResponse contail a 'back' element but no "data" or "plantId".
In order to prevent this Phython-error, I changed the line " if ('back' in apiResponse):" in "if ('back' in apiResponse and strData.find('data') > -1 and strData.find('plantId') > -1):"
Now i do not receive a Phyton-error any more, instead of that I got last night a proper exeption:
Not received anything usefull!: {"back":"503","succes":false}}
The text was updated successfully, but these errors were encountered:
Thanks for your insights.
So just 1 line change and we are good to go?
OLD:
try:
if ('back' in apiResponse):
#if not ['back']['success']:
# Domoticz.Log("Login Failed")
#elif ('back' in apiResponse):
NEW:
try:
if ('back' in apiResponse and strData.find('data') > -1 and strData.find('plantId') > -1):
#if not ['back']['success']:
# Domoticz.Log("Login Failed")
#elif ('back' in apiResponse):
Sometimes I got a Phython-error in the log on line: self.plantId = apiResponse["back"]["data"][0]["plantId"]
the cause was: the apiResponse contail a 'back' element but no "data" or "plantId".
In order to prevent this Phython-error, I changed the line " if ('back' in apiResponse):" in "if ('back' in apiResponse and strData.find('data') > -1 and strData.find('plantId') > -1):"
Now i do not receive a Phyton-error any more, instead of that I got last night a proper exeption:
Not received anything usefull!: {"back":"503","succes":false}}
The text was updated successfully, but these errors were encountered: