9999 valley_electricity_timer ,
100100 volume ,
101101 wash_towel_mode ,
102+ wash_water_temperature ,
102103)
103104from .child_lock import ChildLockTrait
104105from .clean_summary import CleanSummaryTrait
125126from .valley_electricity_timer import ValleyElectricityTimerTrait
126127from .volume import SoundVolumeTrait
127128from .wash_towel_mode import WashTowelModeTrait
129+ from .wash_water_temperature import WashWaterTemperatureTrait , is_wash_water_temperature_offered
128130
129131_LOGGER = logging .getLogger (__name__ )
130132
155157 "valley_electricity_timer" ,
156158 "volume" ,
157159 "wash_towel_mode" ,
160+ "wash_water_temperature" ,
158161]
159162
160163
@@ -189,6 +192,7 @@ class PropertiesApi(Trait):
189192 dust_collection : DustCollectionTrait | None = None
190193 wash_towel_mode : WashTowelModeTrait | None = None
191194 smart_wash_params : SmartWashParamsTrait | None = None
195+ wash_water_temperature : WashWaterTemperatureTrait | None = None
192196 obstacle_photos : ObstaclePhotoTrait | None = None
193197 mop_dryer : MopDryerTrait | None = None
194198 customize_clean_mode : CustomizeCleanModeTrait | None = None
@@ -210,6 +214,7 @@ def __init__(
210214 ) -> None :
211215 """Initialize the V1TraitProps."""
212216 self ._device_uid = device_uid
217+ self ._product = product
213218 self ._rpc_channel = rpc_channel
214219 self ._mqtt_rpc_channel = mqtt_rpc_channel
215220 self ._map_rpc_channel = map_rpc_channel
@@ -297,6 +302,18 @@ async def discover_features(self) -> None:
297302 wash_towel_mode ._rpc_channel = self ._get_rpc_channel (wash_towel_mode ) # type: ignore[assignment]
298303 self .wash_towel_mode = wash_towel_mode
299304
305+ # The wash water temperature needs a washing dock, a device that can heat wash water,
306+ # and a product and dock for which the app shows it.
307+ if (
308+ self .wash_water_temperature is None
309+ and self .device_features .is_hot_wash_towel_supported
310+ and is_wash_water_temperature_offered (self ._product .product_nickname , dock_features )
311+ and self ._is_supported (WashWaterTemperatureTrait , "wash_water_temperature" , dock_features )
312+ ):
313+ wash_water_temperature = WashWaterTemperatureTrait (self .device_features )
314+ wash_water_temperature ._rpc_channel = self ._get_rpc_channel (wash_water_temperature ) # type: ignore[assignment]
315+ self .wash_water_temperature = wash_water_temperature
316+
300317 # The dust collection mode needs both device and dock features
301318 if self .dust_collection_mode is None and supports_dust_collection_mode (self .device_features , dock_features ):
302319 dust_collection_mode = DustCollectionModeTrait ()
@@ -332,7 +349,7 @@ async def discover_features(self) -> None:
332349 # Union args may not be in declared order
333350 item_type = union_args [0 ] if union_args [1 ] is type (None ) else union_args [1 ]
334351 # Created above with constructor arguments or extra gating
335- if item_type in (ObstaclePhotoTrait , DustCollectionModeTrait ):
352+ if item_type in (ObstaclePhotoTrait , DustCollectionModeTrait , WashWaterTemperatureTrait ):
336353 continue
337354 if not self ._is_supported (item_type , item .name , dock_features ):
338355 _LOGGER .debug ("Trait '%s' not supported, skipping" , item .name )
0 commit comments