44from enum import Enum , IntEnum
55
66_LOGGER = logging .getLogger (__name__ )
7+ completed_warnings = set ()
78
89
910class RoborockEnum (IntEnum ):
@@ -16,10 +17,16 @@ def name(self) -> str:
1617 @classmethod
1718 def _missing_ (cls : type [RoborockEnum ], key ) -> RoborockEnum :
1819 if hasattr (cls , "unknown" ):
19- _LOGGER .warning (f"Missing { cls .__name__ } code: { key } - defaulting to 'unknown'" )
20+ warning = f"Missing { cls .__name__ } code: { key } - defaulting to 'unknown'"
21+ if warning not in completed_warnings :
22+ completed_warnings .add (warning )
23+ _LOGGER .warning (warning )
2024 return cls .unknown # type: ignore
2125 default_value = next (item for item in cls )
22- _LOGGER .warning (f"Missing { cls .__name__ } code: { key } - defaulting to { default_value } " )
26+ warning = f"Missing { cls .__name__ } code: { key } - defaulting to { default_value } "
27+ if warning not in completed_warnings :
28+ completed_warnings .add (warning )
29+ _LOGGER .warning (warning )
2330 return default_value
2431
2532 @classmethod
@@ -415,6 +422,93 @@ def __missing__(self, key):
415422 return RoborockCategory .UNKNOWN
416423
417424
425+ class RoborockFinishReason (RoborockEnum ):
426+ manual_interrupt = 21 # Cleaning interrupted by user
427+ cleanup_interrupted = 24 # Cleanup interrupted
428+ manual_interrupt_2 = 21
429+ breakpoint = 32 # Could not continue cleaning
430+ breakpoint_2 = 33
431+ cleanup_interrupted_2 = 34
432+ manual_interrupt_3 = 35
433+ manual_interrupt_4 = 36
434+ manual_interrupt_5 = 37
435+ manual_interrupt_6 = 43
436+ locate_fail = 45 # Positioning Failed
437+ cleanup_interrupted_3 = 64
438+ locate_fail_2 = 65
439+ manual_interrupt_7 = 48
440+ manual_interrupt_8 = 49
441+ manual_interrupt_9 = 50
442+ cleanup_interrupted_4 = 51
443+ finished_cleaning = 52 # Finished cleaning
444+ finished_cleaning_2 = 54
445+ finished_cleaning_3 = 55
446+ finished_cleaning_4 = 56
447+ finished_clenaing_5 = 57
448+ manual_interrupt_10 = 60
449+ area_unreachable = 61 # Area unreachable
450+ area_unreachable_2 = 62
451+ washing_error = 67 # Washing error
452+ back_to_wash_failure = 68 # Failed to return to the dock
453+ cleanup_interrupted_5 = 101
454+ breakpoint_4 = 102
455+ manual_interrupt_11 = 103
456+ cleanup_interrupted_6 = 104
457+ cleanup_interrupted_7 = 105
458+ cleanup_interrupted_8 = 106
459+ cleanup_interrupted_9 = 107
460+ cleanup_interrupted_10 = 109
461+ cleanup_interrupted_11 = 110
462+ patrol_success = 114 # Cruise completed
463+ patrol_fail = 115 # Cruise failed
464+ pet_patrol_success = 116 # Pet found
465+ pet_patrol_fail = 117 # Pet found failed
466+
467+
468+ class RoborockInCleaning (RoborockEnum ):
469+ complete = 0
470+ global_clean_not_complete = 1
471+ zone_clean_not_complete = 2
472+ segment_clean_not_complete = 3
473+
474+
475+ class RoborockCleanType (RoborockEnum ):
476+ all_zone = 1
477+ draw_zone = 2
478+ select_zone = 3
479+ quick_build = 4
480+ video_patrol = 5
481+ pet_patrol = 6
482+
483+
484+ class RoborockStartType (RoborockEnum ):
485+ button = 1
486+ app = 2
487+ schedule = 3
488+ mi_home = 4
489+ quick_start = 5
490+ voice_control = 13
491+ routines = 101
492+ alexa = 801
493+ google = 802
494+ ifttt = 803
495+ yandex = 804
496+ homekit = 805
497+ xiaoai = 806
498+ tmall_genie = 807
499+ duer = 808
500+ dingdong = 809
501+ siri = 810
502+ clova = 811
503+ wechat = 901
504+ alipay = 902
505+ aqara = 903
506+ hisense = 904
507+ huawei = 905
508+ widget_launch = 820
509+ smart_watch = 821
510+
511+
418512class DyadSelfCleanMode (RoborockEnum ):
419513 self_clean = 1
420514 self_clean_and_dry = 2
0 commit comments