Skip to content

Commit

Permalink
Merge pull request #827 from cavefire/quick-response-fix
Browse files Browse the repository at this point in the history
fix for firmware update of D230
  • Loading branch information
JurajNyiri authored Jan 17, 2025
2 parents 25c7248 + e53cf5a commit bd50af9
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion custom_components/tapo_control/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1381,7 +1381,12 @@ async def getCamData(hass, controller):
camData["updated"] = datetime.datetime.utcnow().timestamp()

try:
camData['quick_response'] = data['getQuickRespList']['quick_resp_audio']
if isinstance(data['getQuickRespList'], list):
camData['quick_response'] = data['getQuickRespList'][0]['quick_response']['quick_resp_audio']
elif isinstance(data['getQuickRespList'], dict):
camData['quick_response'] = data['getQuickRespList']['quick_resp_audio']
else:
LOGGER.warning("Quick response data is not in expected format")
except Exception:
camData['quick_response'] = None

Expand Down

0 comments on commit bd50af9

Please sign in to comment.