Skip to content

Commit 03f72b8

Browse files
authored
Disable multi-request on unknown errors (#1027)
Another P100 fix
1 parent 8d1a4a4 commit 03f72b8

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

kasa/smartprotocol.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,14 @@ async def _execute_multiple_query(self, requests: dict, retry_count: int) -> dic
154154
try:
155155
self._handle_response_error_code(response_step, batch_name)
156156
except DeviceError as ex:
157-
# P100 sometimes raises JSON_DECODE_FAIL_ERROR on batched request so
158-
# disable batching
157+
# P100 sometimes raises JSON_DECODE_FAIL_ERROR or INTERNAL_UNKNOWN_ERROR
158+
# on batched request so disable batching
159159
if (
160-
ex.error_code is SmartErrorCode.JSON_DECODE_FAIL_ERROR
160+
ex.error_code
161+
in {
162+
SmartErrorCode.JSON_DECODE_FAIL_ERROR,
163+
SmartErrorCode.INTERNAL_UNKNOWN_ERROR,
164+
}
161165
and self._multi_request_batch_size != 1
162166
):
163167
self._multi_request_batch_size = 1

0 commit comments

Comments
 (0)