From 928a5a9d5b1278ff93d52e591d306925e83e2410 Mon Sep 17 00:00:00 2001 From: sdb9696 Date: Mon, 29 Apr 2024 14:14:44 +0100 Subject: [PATCH] Fix smartprotocol response list handler to handle null reponses --- kasa/smartprotocol.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kasa/smartprotocol.py b/kasa/smartprotocol.py index cbfd16b0f..472d93202 100644 --- a/kasa/smartprotocol.py +++ b/kasa/smartprotocol.py @@ -206,7 +206,8 @@ async def _handle_response_lists( self, response_result: dict[str, Any], method, retry_count ): if ( - isinstance(response_result, SmartErrorCode) + response_result is None + or isinstance(response_result, SmartErrorCode) or "start_index" not in response_result or (list_sum := response_result.get("sum")) is None ):