Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion kasa/smartprotocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,9 @@ async def query(self, request: str | dict, retry_count: int = 3) -> dict:
ret_val = {}
for multi_response in multi_responses:
method = multi_response["method"]
self._handle_response_error_code(multi_response, method)
self._handle_response_error_code(
multi_response, method, raise_on_error=False
)
ret_val[method] = multi_response.get("result")
return ret_val

Expand Down
5 changes: 3 additions & 2 deletions kasa/tests/test_smartprotocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,9 @@ async def test_childdevicewrapper_multiplerequest_error(dummy_protocol, mocker):
}
wrapped_protocol = _ChildProtocolWrapper("dummyid", dummy_protocol)
mocker.patch.object(wrapped_protocol._transport, "send", return_value=mock_response)
with pytest.raises(KasaException):
await wrapped_protocol.query(DUMMY_QUERY)
res = await wrapped_protocol.query(DUMMY_QUERY)
assert res["get_device_info"] == {"foo": "bar"}
assert res["invalid_command"] == SmartErrorCode(-1001)


@pytest.mark.parametrize("list_sum", [5, 10, 30])
Expand Down