File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
roborock/devices/traits/v1 Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 11"""Trait for wash towel mode."""
22
33from functools import cached_property
4+ from typing import Self
45
56from roborock .data import WashTowelMode , WashTowelModes , get_wash_towel_modes
67from roborock .device_features import is_wash_n_fill_dock
@@ -18,11 +19,17 @@ class WashTowelModeTrait(WashTowelMode, common.V1TraitMixin):
1819 def __init__ (
1920 self ,
2021 device_feature_trait : DeviceFeaturesTrait ,
21- wash_mode : WashTowelModes | None = None ,
2222 ) -> None :
2323 super ().__init__ ()
2424 self .device_feature_trait = device_feature_trait
25- self .wash_mode = wash_mode
25+
26+ def _parse_response (self , response : common .V1ResponseData ) -> Self :
27+ """Parse the response from the device into a WashTowelMode object."""
28+ if isinstance (response , list ):
29+ response = response [0 ]
30+ if isinstance (response , dict ):
31+ return WashTowelMode .from_dict (response )
32+ raise ValueError (f"Unexpected wash towel mode format: { response !r} " )
2633
2734 @cached_property
2835 def wash_towel_mode_options (self ) -> list [WashTowelModes ]:
You can’t perform that action at this time.
0 commit comments