mirror of
https://github.com/python-kasa/python-kasa.git
synced 2024-12-22 19:23:34 +00:00
parent
8d1a4a4229
commit
03f72b8be0
@ -154,10 +154,14 @@ class SmartProtocol(BaseProtocol):
|
|||||||
try:
|
try:
|
||||||
self._handle_response_error_code(response_step, batch_name)
|
self._handle_response_error_code(response_step, batch_name)
|
||||||
except DeviceError as ex:
|
except DeviceError as ex:
|
||||||
# P100 sometimes raises JSON_DECODE_FAIL_ERROR on batched request so
|
# P100 sometimes raises JSON_DECODE_FAIL_ERROR or INTERNAL_UNKNOWN_ERROR
|
||||||
# disable batching
|
# on batched request so disable batching
|
||||||
if (
|
if (
|
||||||
ex.error_code is SmartErrorCode.JSON_DECODE_FAIL_ERROR
|
ex.error_code
|
||||||
|
in {
|
||||||
|
SmartErrorCode.JSON_DECODE_FAIL_ERROR,
|
||||||
|
SmartErrorCode.INTERNAL_UNKNOWN_ERROR,
|
||||||
|
}
|
||||||
and self._multi_request_batch_size != 1
|
and self._multi_request_batch_size != 1
|
||||||
):
|
):
|
||||||
self._multi_request_batch_size = 1
|
self._multi_request_batch_size = 1
|
||||||
|
Loading…
Reference in New Issue
Block a user