Update dump_devinfo for smart camera protocol (#1169)

Introduces the child camera protocol wrapper, required to get the child device info with the new protocol.
This commit is contained in:
Steven B.
2024-10-18 12:06:22 +01:00
committed by GitHub
parent 486984fff8
commit acd0202cab
6 changed files with 1076 additions and 97 deletions

View File

@@ -163,6 +163,7 @@ class SmartProtocol(BaseProtocol):
]
end = len(multi_requests)
# Break the requests down as there can be a size limit
step = self._multi_request_batch_size
if step == 1:
@@ -175,6 +176,10 @@ class SmartProtocol(BaseProtocol):
multi_result[method] = resp["result"]
return multi_result
# The SmartCameraProtocol sends requests with a length 1 as a
# multipleRequest. The SmartProtocol doesn't so will never
# raise_on_error
raise_on_error = end == 1
for batch_num, i in enumerate(range(0, end, step)):
requests_step = multi_requests[i : i + step]
@@ -222,7 +227,9 @@ class SmartProtocol(BaseProtocol):
responses = response_step["result"]["responses"]
for response in responses:
method = response["method"]
self._handle_response_error_code(response, method, raise_on_error=False)
self._handle_response_error_code(
response, method, raise_on_error=raise_on_error
)
result = response.get("result", None)
await self._handle_response_lists(
result, method, retry_count=retry_count