@@ -237,6 +237,15 @@ class NetworkInfoField(str, Enum):
237237 RSSI = "rssi"
238238
239239
240+ class RoborockDeviceInfoField (str , Enum ):
241+ DEVICE = "device"
242+ PRODUCT = "product"
243+
244+
245+ class RoborockLocalDeviceInfoField (str , Enum ):
246+ NETWORK_INFO = "network_info"
247+
248+
240249class RoborockBase (dict ):
241250 def __init__ (self , data : dict [str , any ]) -> None :
242251 super ().__init__ ()
@@ -248,8 +257,6 @@ def as_dict(self):
248257
249258
250259class Reference (RoborockBase ):
251- def __init__ (self , data : dict [str , any ]) -> None :
252- super ().__init__ (data )
253260
254261 @property
255262 def region (self ) -> str :
@@ -269,8 +276,6 @@ def l_unknown(self) -> str:
269276
270277
271278class RRiot (RoborockBase ):
272- def __init__ (self , data : dict [str , any ]) -> None :
273- super ().__init__ (data )
274279
275280 @property
276281 def user (self ) -> str :
@@ -294,8 +299,6 @@ def reference(self) -> Reference:
294299
295300
296301class UserData (RoborockBase ):
297- def __init__ (self , data : dict [str , any ]) -> None :
298- super ().__init__ (data )
299302
300303 @property
301304 def uid (self ) -> int :
@@ -343,8 +346,6 @@ def avatar_url(self) -> str:
343346
344347
345348class LoginData (RoborockBase ):
346- def __init__ (self , data : dict [str , any ]) -> None :
347- super ().__init__ (data )
348349
349350 @property
350351 def user_data (self ) -> UserData :
@@ -364,8 +365,6 @@ def email(self):
364365
365366
366367class HomeDataProductSchema (RoborockBase ):
367- def __init__ (self , data : dict [str , any ]) -> None :
368- super ().__init__ (data )
369368
370369 @property
371370 def id (self ):
@@ -397,8 +396,6 @@ def desc(self):
397396
398397
399398class HomeDataProduct (RoborockBase ):
400- def __init__ (self , data : dict [str , any ]) -> None :
401- super ().__init__ (data )
402399
403400 @property
404401 def id (self ) -> str :
@@ -438,8 +435,6 @@ def schema(self) -> list[HomeDataProductSchema]:
438435
439436
440437class HomeDataDeviceStatus (RoborockBase ):
441- def __init__ (self , data : dict [str , any ]) -> None :
442- super ().__init__ (data )
443438
444439 @property
445440 def id (self ):
@@ -479,8 +474,6 @@ def schema(self):
479474
480475
481476class HomeDataDevice (RoborockBase ):
482- def __init__ (self , data : dict [str , any ]) -> None :
483- super ().__init__ (data )
484477
485478 @property
486479 def duid (self ) -> str :
@@ -584,8 +577,6 @@ def silent_ota_switch(self) -> bool:
584577
585578
586579class HomeDataRoom (RoborockBase ):
587- def __init__ (self , data : dict [str , any ]) -> None :
588- super ().__init__ (data )
589580
590581 @property
591582 def id (self ):
@@ -597,8 +588,6 @@ def name(self):
597588
598589
599590class HomeData (RoborockBase ):
600- def __init__ (self , data : dict [str , any ]) -> None :
601- super ().__init__ (data )
602591
603592 @property
604593 def id (self ) -> int :
@@ -638,8 +627,6 @@ def rooms(self) -> list[HomeDataRoom]:
638627
639628
640629class Status (RoborockBase ):
641- def __init__ (self , data : dict [str , any ]) -> None :
642- super ().__init__ (data )
643630
644631 @property
645632 def msg_ver (self ) -> int :
@@ -839,8 +826,6 @@ def unsave_map_flag(self) -> int:
839826
840827
841828class DNDTimer (RoborockBase ):
842- def __init__ (self , data : dict [str , any ]) -> None :
843- super ().__init__ (data )
844829
845830 @property
846831 def start_hour (self ) -> int :
@@ -864,8 +849,6 @@ def enabled(self) -> int:
864849
865850
866851class CleanSummary (RoborockBase ):
867- def __init__ (self , data : dict [str , any ]) -> None :
868- super ().__init__ (data )
869852
870853 @property
871854 def clean_time (self ) -> int :
@@ -889,8 +872,6 @@ def records(self) -> list[int]:
889872
890873
891874class CleanRecord (RoborockBase ):
892- def __init__ (self , data : dict [str , any ]) -> None :
893- super ().__init__ (data )
894875
895876 @property
896877 def begin (self ) -> int :
@@ -946,8 +927,6 @@ def map_flag(self) -> int:
946927
947928
948929class Consumable (RoborockBase ):
949- def __init__ (self , data : dict [str , any ]) -> None :
950- super ().__init__ (data )
951930
952931 @property
953932 def main_brush_work_time (self ) -> int :
@@ -983,8 +962,6 @@ def cleaning_brush_work_times(self) -> int:
983962
984963
985964class MultiMapsListMapInfoBakMaps (RoborockBase ):
986- def __init__ (self , data : dict [str , any ]) -> None :
987- super ().__init__ (data )
988965
989966 @property
990967 def mapflag (self ):
@@ -996,8 +973,6 @@ def add_time(self):
996973
997974
998975class MultiMapsListMapInfo (RoborockBase ):
999- def __init__ (self , data : dict [str , any ]) -> None :
1000- super ().__init__ (data )
1001976
1002977 @property
1003978 def mapflag (self ):
@@ -1021,8 +996,6 @@ def bak_maps(self):
1021996
1022997
1023998class MultiMapsList (RoborockBase ):
1024- def __init__ (self , data : dict [str , any ]) -> None :
1025- super ().__init__ (data )
1026999
10271000 @property
10281001 def max_multi_map (self ) -> int :
@@ -1042,8 +1015,6 @@ def map_info(self) -> list[MultiMapsListMapInfo]:
10421015
10431016
10441017class SmartWashParameters (RoborockBase ):
1045- def __init__ (self , data : dict [str , any ]) -> None :
1046- super ().__init__ (data )
10471018
10481019 @property
10491020 def smart_wash (self ) -> int :
@@ -1053,22 +1024,40 @@ def smart_wash(self) -> int:
10531024 def wash_interval (self ) -> int :
10541025 return self .get (SmartWashField .WASH_INTERVAL )
10551026
1056- class NetworkInfo (RoborockBase ):
1057- def __init__ (self , data : dict [str , any ]) -> None :
1058- super ().__init__ (data )
10591027
1028+ class NetworkInfo (RoborockBase ):
10601029 @property
10611030 def ssid (self ) -> str :
10621031 return self .get (NetworkInfoField .SSID )
1032+
10631033 @property
10641034 def ip (self ) -> str :
10651035 return self .get (NetworkInfoField .IP )
1036+
10661037 @property
10671038 def mac (self ) -> str :
10681039 return self .get (NetworkInfoField .MAC )
1040+
10691041 @property
10701042 def bssid (self ) -> str :
10711043 return self .get (NetworkInfoField .BSSID )
1044+
10721045 @property
10731046 def rssi (self ) -> int :
10741047 return self .get (NetworkInfoField .RSSI )
1048+
1049+
1050+ class RoborockDeviceInfo (RoborockBase ):
1051+ @property
1052+ def device (self ) -> HomeDataDevice :
1053+ return HomeDataDevice (self .get (RoborockDeviceInfoField .DEVICE ))
1054+
1055+ @property
1056+ def product (self ) -> HomeDataProduct :
1057+ return HomeDataProduct (self .get (RoborockDeviceInfoField .PRODUCT ))
1058+
1059+
1060+ class RoborockLocalDeviceInfo (RoborockDeviceInfo ):
1061+ @property
1062+ def network_info (self ) -> NetworkInfo :
1063+ return NetworkInfo (self .get (RoborockLocalDeviceInfoField .NETWORK_INFO ))
0 commit comments