MCPcopy Create free account
hub / github.com/FastLED/FastLED / RpcResponse

Class RpcResponse

ci/rpc_client.py:52–74  ·  view source on GitHub ↗

Structured RPC response with internal request ID correlation. The request ID is managed internally for correlation and is not exposed in the public API. Users should only interact with success, data, and raw_line.

Source from the content-addressed store, hash-verified

50
51@dataclass
52class RpcResponse:
53 """Structured RPC response with internal request ID correlation.
54
55 The request ID is managed internally for correlation and is not exposed
56 in the public API. Users should only interact with success, data, and raw_line.
57 """
58
59 success: bool
60 data: dict[str, Any]
61 raw_line: str
62 _id: int = 0 # Internal: Request ID from JSON-RPC 2.0 (always present, hidden from public API)
63
64 def get(self, key: str, default: Any = None) -> Any:
65 """Get value from response data."""
66 return self.data.get(key, default)
67
68 def __getitem__(self, key: str) -> Any:
69 """Allow dict-like access to response data."""
70 return self.data[key]
71
72 def __contains__(self, key: str) -> bool:
73 """Check if key exists in response data."""
74 return key in self.data
75
76
77class RpcTimeoutError(TimeoutError):

Callers 3

send_and_matchMethod · 0.85
_wait_for_responseMethod · 0.85

Calls

no outgoing calls

Tested by 1