Skip to content

Commit cddd765

Browse files
authored
feat: add more codes for status (#55)
1 parent 71668ab commit cddd765

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

roborock/api.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
MultiMapsList,
3131
NetworkInfo,
3232
RoomMapping,
33+
S7MaxVStatus,
3334
SmartWashParams,
3435
Status,
3536
UserData,
@@ -227,7 +228,9 @@ async def send_command(self, method: RoborockCommand, params: Optional[list | di
227228
async def get_status(self) -> Status | None:
228229
status = await self.send_command(RoborockCommand.GET_STATUS)
229230
if isinstance(status, dict):
230-
_cls: Type[Status] = ModelStatus[self.device_info.model]
231+
_cls: Type[Status] = ModelStatus.get(
232+
self.device_info.model, S7MaxVStatus
233+
) # Default to S7 MAXV if we don't have the data
231234
return _cls.from_dict(status)
232235

233236
return None

roborock/code_mappings.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ class RoborockFanSpeedS7MaxV(RoborockFanPowerCode):
149149
balanced = 102
150150
turbo = 103
151151
max = 104
152+
custom = 106
152153
max_plus = 108
153154

154155

roborock/const.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
ROBOROCK_Q7 = "roborock.vacuum.a37" # CHECK THIS
2424
ROBOROCK_Q7_MAX = "roborock.vacuum.a38"
2525
ROBOROCK_Q7PLUS = "roborock.vacuum.a40"
26+
ROBOROCK_G10S_PRO = "roborock.vacuum.a26"
2627
ROBOROCK_G10S = "roborock.vacuum.a46"
2728
ROBOROCK_G10 = "roborock.vacuum.a29"
2829
ROBOROCK_S7 = "roborock.vacuum.a15"
@@ -37,6 +38,7 @@
3738
SUPPORTED_VACUUMS = (
3839
[ # These are the devices that show up when you add a device - more could be supported and just not show up
3940
ROBOROCK_G10,
41+
ROBOROCK_G10S_PRO,
4042
ROBOROCK_Q5,
4143
ROBOROCK_Q7,
4244
ROBOROCK_Q7_MAX,

roborock/containers.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,11 @@
3131
from .const import (
3232
FILTER_REPLACE_TIME,
3333
MAIN_BRUSH_REPLACE_TIME,
34+
ROBOROCK_G10S_PRO,
3435
ROBOROCK_Q7_MAX,
3536
ROBOROCK_S4_MAX,
3637
ROBOROCK_S5_MAX,
38+
ROBOROCK_S6,
3739
ROBOROCK_S6_MAXV,
3840
ROBOROCK_S6_PURE,
3941
ROBOROCK_S7,
@@ -306,11 +308,13 @@ class S8ProUltraStatus(Status):
306308
ROBOROCK_S4_MAX: S4MaxStatus,
307309
ROBOROCK_S5_MAX: S5MaxStatus,
308310
ROBOROCK_Q7_MAX: Q7MaxStatus,
311+
ROBOROCK_S6: S6PureStatus,
309312
ROBOROCK_S6_MAXV: S6MaxVStatus,
310313
ROBOROCK_S6_PURE: S6PureStatus,
311314
ROBOROCK_S7_MAXV: S7MaxVStatus,
312315
ROBOROCK_S7: S7Status,
313316
ROBOROCK_S8_PRO_ULTRA: S8ProUltraStatus,
317+
ROBOROCK_G10S_PRO: S7MaxVStatus,
314318
}
315319

316320

0 commit comments

Comments
 (0)