File tree Expand file tree Collapse file tree 1 file changed +11
-7
lines changed
Expand file tree Collapse file tree 1 file changed +11
-7
lines changed Original file line number Diff line number Diff line change 1+ from typing import Self
2+
13from ..code_mappings import RoborockModeEnum
24
35
@@ -155,6 +157,13 @@ class YXRoomMaterial(RoborockModeEnum):
155157 OTHER = "other" , 255
156158
157159
160+ _YX_CLEAN_TYPE_LEGACY_VALUES : dict [str , str ] = {
161+ "bothwork" : "vac_and_mop" ,
162+ "onlysweep" : "vacuum" ,
163+ "onlymop" : "mop" ,
164+ }
165+
166+
158167class YXCleanType (RoborockModeEnum ):
159168 UNKNOWN = "unknown" , - 1
160169 VAC_AND_MOP = "vac_and_mop" , 1
@@ -167,14 +176,9 @@ class YXCleanType(RoborockModeEnum):
167176 ONLY_MOP = MOP
168177
169178 @classmethod
170- def from_value (cls , value : str ):
179+ def from_value (cls , value : str ) -> Self :
171180 """Find enum member by string value with legacy support."""
172- legacy_values = {
173- "bothwork" : "vac_and_mop" ,
174- "onlysweep" : "vacuum" ,
175- "onlymop" : "mop" ,
176- }
177- normalized_value = legacy_values .get (value .lower (), value )
181+ normalized_value = _YX_CLEAN_TYPE_LEGACY_VALUES .get (value .lower (), value )
178182 return super ().from_value (normalized_value )
179183
180184
You can’t perform that action at this time.
0 commit comments