File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,14 @@ class _LocalProtocol(asyncio.Protocol):
2525 messages_cb : Callable [[bytes ], None ]
2626 connection_lost_cb : Callable [[Exception | None ], None ]
2727
28+ def data_received (self , bytes ) -> None :
29+ """Called when data is received from the transport."""
30+ self .messages_cb (bytes )
31+
32+ def connection_lost (self , exc : Exception | None ) -> None :
33+ """Called when the transport connection is lost."""
34+ self .connection_lost_cb (exc )
35+
2836
2937class RoborockLocalClient (RoborockClient , ABC ):
3038 """Roborock local client base class."""
Original file line number Diff line number Diff line change @@ -209,7 +209,7 @@ def handle_write(data: bytes) -> None:
209209 if response is not None :
210210 _LOGGER .debug ("Replying with %s" , response )
211211 loop = asyncio .get_running_loop ()
212- loop .call_soon (protocol .messages_cb , response )
212+ loop .call_soon (protocol .data_received , response )
213213
214214 closed = asyncio .Event ()
215215
You can’t perform that action at this time.
0 commit comments