Skip to content

Commit e792728

Browse files
fix: command prefixes
1 parent 2fffce1 commit e792728

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

roborock/api.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -274,13 +274,12 @@ async def get_dock_summary(self, device_id: str, dock_type: RoborockEnum) -> Doc
274274
return None
275275

276276
async def get_prop(self, device_id: str) -> DeviceProp | None:
277-
[status, dnd_timer, clean_summary, consumable, multi_maps_list] = await asyncio.gather(
277+
[status, dnd_timer, clean_summary, consumable] = await asyncio.gather(
278278
*[
279279
self.get_status(device_id),
280280
self.get_dnd_timer(device_id),
281281
self.get_clean_summary(device_id),
282-
self.get_consumable(device_id),
283-
self.get_multi_maps_list(device_id)
282+
self.get_consumable(device_id)
284283
]
285284
)
286285
last_clean_record = None
@@ -297,7 +296,6 @@ async def get_prop(self, device_id: str) -> DeviceProp | None:
297296
consumable,
298297
last_clean_record,
299298
dock_summary,
300-
multi_maps_list
301299
)
302300
return None
303301

@@ -324,7 +322,7 @@ async def get_room_mapping(self, device_id: str) -> list[RoomMapping]:
324322
mapping = await self.send_command(device_id, RoborockCommand.GET_ROOM_MAPPING)
325323
if isinstance(mapping, list):
326324
return [
327-
RoomMapping(segment_id, iot_id)
325+
RoomMapping(segment_id=segment_id, iot_id=segment_id) # type: ignore
328326
for segment_id, iot_id in [unpack_list(room, 2) for room in mapping]
329327
]
330328
return []
@@ -463,8 +461,7 @@ async def get_home_data(self, user_data: UserData) -> HomeData:
463461
home_request = PreparedRequest(
464462
rriot.r.a,
465463
{
466-
"Authorization": f'Hawk id="{rriot.u}", s="{rriot.s}", ts="{timestamp}", nonce="{nonce}", '
467-
f'mac="{mac}"',
464+
"Authorization": f'Hawk id="{rriot.u}", s="{rriot.s}", ts="{timestamp}", nonce="{nonce}", mac="{mac}"',
468465
},
469466
)
470467
home_response = await home_request.request("get", "/user/homes/" + str(home_id))

roborock/typing.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ class CommandInfo:
120120
RoborockCommand.GET_STATUS: CommandInfo(prefix=b"\x00\x00\x00\x77"),
121121
RoborockCommand.SET_CUSTOM_MODE: CommandInfo(prefix=b"\x00\x00\x00w"),
122122
RoborockCommand.GET_CHILD_LOCK_STATUS: CommandInfo(prefix=b"\x00\x00\x00\x87"),
123-
RoborockCommand.GET_MULTI_MAPS_LIST: CommandInfo(prefix=b"\x00\x00\x00\xd7"),
123+
RoborockCommand.GET_MULTI_MAPS_LIST: CommandInfo(prefix=b"\x00\x00\x00\x87"),
124124
RoborockCommand.GET_IDENTIFY_FURNITURE_STATUS: CommandInfo(prefix=b"\x00\x00\x00\x87"),
125125
RoborockCommand.SET_WATER_BOX_CUSTOM_MODE: CommandInfo(prefix=b"\x00\x00\x00\x87"),
126126
RoborockCommand.GET_CLEAN_SEQUENCE: CommandInfo(prefix=b"\x00\x00\x00\x87"),
@@ -223,4 +223,3 @@ class DeviceProp:
223223
consumable: Optional[Consumable] = None
224224
last_clean_record: Optional[CleanRecord] = None
225225
dock_summary: Optional[DockSummary] = None
226-
multi_maps_list: Optional[MultiMapsList] = None

0 commit comments

Comments
 (0)