Skip to content

Commit b19139b

Browse files
Lash-LCopilot
andauthored
chore: update roborock/protocols/v1_protocol.py
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent a4b7c92 commit b19139b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

roborock/protocols/v1_protocol.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,11 @@ def decode_rpc_response(message: RoborockMessage) -> ResponseMessage:
155155
exc: RoborockException | None = None
156156
if error := data_point_response.get("error"):
157157
exc = RoborockException(error)
158-
if (result := data_point_response.get("result")) is None:
158+
if "result" not in data_point_response:
159159
exc = RoborockException(f"Invalid V1 message format: missing 'result' in data point for {message.payload!r}")
160+
result = None
160161
else:
162+
result = data_point_response["result"]
161163
_LOGGER.debug("Decoded V1 message result: %s", result)
162164
if isinstance(result, str):
163165
if result == "unknown_method":

0 commit comments

Comments
 (0)