99from dacite import Config , from_dict
1010
1111from .code_mappings import (
12- ModelSpecification ,
1312 RoborockDockDustCollectionModeCode ,
1413 RoborockDockErrorCode ,
1514 RoborockDockTypeCode ,
1615 RoborockDockWashTowelModeCode ,
1716 RoborockErrorCode ,
1817 RoborockFanPowerCode ,
18+ RoborockFanSpeedE2 ,
19+ RoborockFanSpeedQ7Max ,
20+ RoborockFanSpeedS6Pure ,
21+ RoborockFanSpeedS7 ,
22+ RoborockFanSpeedS7MaxV ,
1923 RoborockMopIntensityCode ,
24+ RoborockMopIntensityS7 ,
25+ RoborockMopIntensityV2 ,
2026 RoborockMopModeCode ,
27+ RoborockMopModeS7 ,
28+ RoborockMopModeS8ProUltra ,
2129 RoborockStateCode ,
22- model_specifications ,
2330)
2431from .const import (
2532 FILTER_REPLACE_TIME ,
2633 MAIN_BRUSH_REPLACE_TIME ,
34+ ROBOROCK_Q7_MAX ,
35+ ROBOROCK_S5_MAX ,
36+ ROBOROCK_S6_MAXV ,
37+ ROBOROCK_S6_PURE ,
38+ ROBOROCK_S7 ,
2739 ROBOROCK_S7_MAXV ,
40+ ROBOROCK_S8_PRO_ULTRA ,
2841 SENSOR_DIRTY_REPLACE_TIME ,
2942 SIDE_BRUSH_REPLACE_TIME ,
3043)
@@ -126,28 +139,6 @@ class HomeDataProduct(RoborockBase):
126139 capability : Optional [int ] = None
127140 category : Optional [str ] = None
128141 schema : Optional [list [HomeDataProductSchema ]] = None
129- model_specification : Optional [ModelSpecification ] = None
130-
131- def __post_init__ (self ):
132- if self .model not in model_specifications :
133- _LOGGER .warning ("We don't have specific device information for your model, please open an issue." )
134- self .model_specification = model_specifications .get (ROBOROCK_S7_MAXV )
135- else :
136- self .model_specification = model_specifications .get (self .model )
137-
138-
139- @dataclass
140- class HomeDataDeviceStatus (RoborockBase ):
141- id : Optional [Any ] = None
142- name : Optional [Any ] = None
143- code : Optional [Any ] = None
144- model : Optional [str ] = None
145- icon_url : Optional [Any ] = None
146- attribute : Optional [Any ] = None
147- capability : Optional [Any ] = None
148- category : Optional [Any ] = None
149- schema : Optional [Any ] = None
150- model_specification : Optional [ModelSpecification ] = None
151142
152143
153144@dataclass
@@ -175,7 +166,7 @@ class HomeDataDevice(RoborockBase):
175166 sn : Optional [str ] = None
176167 feature_set : Optional [str ] = None
177168 new_feature_set : Optional [str ] = None
178- device_status : Optional [HomeDataDeviceStatus ] = None
169+ device_status : Optional [dict ] = None
179170 silent_ota_switch : Optional [bool ] = None
180171
181172
@@ -231,14 +222,12 @@ class Status(RoborockBase):
231222 back_type : Optional [int ] = None
232223 wash_phase : Optional [int ] = None
233224 wash_ready : Optional [int ] = None
234- fan_power : Optional [int ] = None
235- fan_power_enum : Optional [Type [RoborockFanPowerCode ]] = None
225+ fan_power : Optional [RoborockFanPowerCode ] = None
236226 dnd_enabled : Optional [int ] = None
237227 map_status : Optional [int ] = None
238228 is_locating : Optional [int ] = None
239229 lock_status : Optional [int ] = None
240- water_box_mode : Optional [int ] = None
241- water_box_mode_enum : Optional [Type [RoborockMopIntensityCode ]] = None
230+ water_box_mode : Optional [RoborockMopIntensityCode ] = None
242231 water_box_carriage_status : Optional [int ] = None
243232 mop_forbidden_enable : Optional [int ] = None
244233 camera_status : Optional [int ] = None
@@ -251,8 +240,7 @@ class Status(RoborockBase):
251240 dust_collection_status : Optional [int ] = None
252241 auto_dust_collection : Optional [int ] = None
253242 avoid_count : Optional [int ] = None
254- mop_mode : Optional [int ] = None
255- mop_mode_enum : Optional [Type [RoborockMopModeCode ]] = None
243+ mop_mode : Optional [RoborockMopModeCode ] = None
256244 debug_mode : Optional [int ] = None
257245 collision_avoid_status : Optional [int ] = None
258246 switch_map_mode : Optional [int ] = None
@@ -261,12 +249,60 @@ class Status(RoborockBase):
261249 unsave_map_reason : Optional [int ] = None
262250 unsave_map_flag : Optional [int ] = None
263251
264- def update_status (self , model_specification : ModelSpecification ) -> None :
265- self .fan_power_enum = model_specification .fan_power_code .as_enum_dict ()[self .fan_power ]
266- if model_specification .mop_mode_code is not None :
267- self .mop_mode_enum = model_specification .mop_mode_code .as_enum_dict ()[self .mop_mode ]
268- if model_specification .mop_intensity_code is not None :
269- self .water_box_mode_enum = model_specification .mop_intensity_code .as_enum_dict ()[self .water_box_mode ]
252+
253+ @dataclass
254+ class S5MaxStatus (Status ):
255+ fan_power : Optional [RoborockFanSpeedS6Pure ] = None
256+ water_box_mode : Optional [RoborockMopIntensityV2 ] = None
257+
258+
259+ @dataclass
260+ class Q7MaxStatus (Status ):
261+ fan_power : Optional [RoborockFanSpeedQ7Max ] = None
262+ water_box_mode : Optional [RoborockMopIntensityV2 ] = None
263+
264+
265+ @dataclass
266+ class S6MaxVStatus (Status ):
267+ fan_power : Optional [RoborockFanSpeedE2 ] = None
268+ water_box_mode : Optional [RoborockMopIntensityV2 ] = None
269+
270+
271+ @dataclass
272+ class S6PureStatus (Status ):
273+ fan_power : Optional [RoborockFanSpeedS6Pure ] = None
274+
275+
276+ @dataclass
277+ class S7MaxVStatus (Status ):
278+ fan_power : Optional [RoborockFanSpeedS7MaxV ] = None
279+ water_box_mode : Optional [RoborockMopIntensityS7 ] = None
280+ mop_mode : Optional [RoborockMopModeS7 ] = None
281+
282+
283+ @dataclass
284+ class S7Status (Status ):
285+ fan_power : Optional [RoborockFanSpeedS7 ] = None
286+ water_box_mode : Optional [RoborockMopIntensityS7 ] = None
287+ mop_mode : Optional [RoborockMopModeS7 ] = None
288+
289+
290+ @dataclass
291+ class S8ProUltraStatus (Status ):
292+ fan_power : Optional [RoborockFanSpeedS7MaxV ] = None
293+ water_box_mode : Optional [RoborockMopIntensityS7 ] = None
294+ mop_mode : Optional [RoborockMopModeS8ProUltra ] = None
295+
296+
297+ ModelStatus : dict [str , Type [Status ]] = {
298+ ROBOROCK_S5_MAX : S5MaxStatus ,
299+ ROBOROCK_Q7_MAX : Q7MaxStatus ,
300+ ROBOROCK_S6_MAXV : S6MaxVStatus ,
301+ ROBOROCK_S6_PURE : S6PureStatus ,
302+ ROBOROCK_S7_MAXV : S7MaxVStatus ,
303+ ROBOROCK_S7 : S7Status ,
304+ ROBOROCK_S8_PRO_ULTRA : S8ProUltraStatus ,
305+ }
270306
271307
272308@dataclass
@@ -385,7 +421,7 @@ class NetworkInfo(RoborockBase):
385421@dataclass
386422class RoborockDeviceInfo (RoborockBase ):
387423 device : HomeDataDevice
388- model_specification : ModelSpecification
424+ model : str
389425
390426
391427@dataclass
0 commit comments