Skip to content

Commit dfa44ff

Browse files
fix: adding hello command
1 parent 57f72ef commit dfa44ff

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

roborock/local_api.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ async def async_connect(self) -> None:
6363
self.transport, _ = await self.loop.create_connection( # type: ignore
6464
lambda: self, self.host, 58867
6565
)
66+
await self.hello()
6667
_LOGGER.info(f"Connected to {self.host}")
6768
except Exception as e:
6869
_LOGGER.warning(f"Failed connecting to {self.host}: {e}")
@@ -94,6 +95,16 @@ def build_roborock_message(self, method: RoborockCommand, params: Optional[list
9495
payload=payload,
9596
)
9697

98+
async def hello(self):
99+
request_id = 1
100+
_LOGGER.debug(f"id={request_id} Requesting method hello with None")
101+
try:
102+
return await self.send_message(
103+
RoborockMessage(protocol=0, payload=None, seq=request_id, version=b"1.0", random=22)
104+
)
105+
except Exception as e:
106+
_LOGGER.error(e)
107+
97108
async def ping(self):
98109
request_id = 2
99110
_LOGGER.debug(f"id={request_id} Requesting method ping with None")

0 commit comments

Comments
 (0)