Skip to content

Commit 3001798

Browse files
fix: adding log for local disconnection
1 parent 1280e10 commit 3001798

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

roborock/local_api.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ def data_received(self, message):
3939
self.on_message_received(parser_msg)
4040

4141
def connection_lost(self, exc: Optional[Exception]):
42+
self.sync_disconnect()
4243
self.on_connection_lost(exc)
4344

4445
def is_connected(self):
@@ -61,6 +62,7 @@ async def async_connect(self) -> None:
6162

6263
def sync_disconnect(self) -> None:
6364
if self.transport and self.loop.is_running():
65+
_LOGGER.debug(f"Disconnecting from {self.host}")
6466
self.transport.close()
6567

6668
async def async_disconnect(self) -> None:
@@ -123,7 +125,6 @@ async def send_message(self, roborock_messages: list[RoborockMessage] | Roborock
123125
local_key = self.device_info.device.local_key
124126
msg = MessageParser.build(roborock_messages, local_key=local_key)
125127
# Send the command to the Roborock device
126-
_LOGGER.debug(f"Requesting device with {roborock_messages}")
127128
self._send_msg_raw(msg)
128129

129130
responses = await asyncio.gather(

0 commit comments

Comments
 (0)