4040from roborock .devices .traits import Trait
4141from roborock .devices .v1_rpc_channel import V1RpcChannel
4242from roborock .map .map_parser import MapParserConfig
43+ from roborock .web_api import UserWebApiClient
4344
4445from .child_lock import ChildLockTrait
4546from .clean_summary import CleanSummaryTrait
5657from .maps import MapsTrait
5758from .network_info import NetworkInfoTrait
5859from .rooms import RoomsTrait
60+ from .routines import RoutinesTrait
5961from .smart_wash_params import SmartWashParamsTrait
6062from .status import StatusTrait
6163from .valley_electricity_timer import ValleyElectricityTimerTrait
8587 "WashTowelModeTrait" ,
8688 "SmartWashParamsTrait" ,
8789 "NetworkInfoTrait" ,
90+ "RoutinesTrait" ,
8891]
8992
9093
@@ -108,6 +111,7 @@ class PropertiesApi(Trait):
108111 home : HomeTrait
109112 device_features : DeviceFeaturesTrait
110113 network_info : NetworkInfoTrait
114+ routines : RoutinesTrait
111115
112116 # Optional features that may not be supported on all devices
113117 child_lock : ChildLockTrait | None = None
@@ -126,6 +130,7 @@ def __init__(
126130 rpc_channel : V1RpcChannel ,
127131 mqtt_rpc_channel : V1RpcChannel ,
128132 map_rpc_channel : V1RpcChannel ,
133+ web_api : UserWebApiClient ,
129134 cache : Cache ,
130135 map_parser_config : MapParserConfig | None = None ,
131136 ) -> None :
@@ -134,6 +139,7 @@ def __init__(
134139 self ._rpc_channel = rpc_channel
135140 self ._mqtt_rpc_channel = mqtt_rpc_channel
136141 self ._map_rpc_channel = map_rpc_channel
142+ self ._web_api = web_api
137143 self ._cache = cache
138144
139145 self .status = StatusTrait (product )
@@ -144,6 +150,7 @@ def __init__(
144150 self .home = HomeTrait (self .status , self .maps , self .map_content , self .rooms , cache )
145151 self .device_features = DeviceFeaturesTrait (product .product_nickname , cache )
146152 self .network_info = NetworkInfoTrait (device_uid , cache )
153+ self .routines = RoutinesTrait (device_uid , web_api )
147154
148155 # Dynamically create any traits that need to be populated
149156 for item in fields (self ):
@@ -267,6 +274,7 @@ def create(
267274 rpc_channel : V1RpcChannel ,
268275 mqtt_rpc_channel : V1RpcChannel ,
269276 map_rpc_channel : V1RpcChannel ,
277+ web_api : UserWebApiClient ,
270278 cache : Cache ,
271279 map_parser_config : MapParserConfig | None = None ,
272280) -> PropertiesApi :
@@ -278,6 +286,7 @@ def create(
278286 rpc_channel ,
279287 mqtt_rpc_channel ,
280288 map_rpc_channel ,
289+ web_api ,
281290 cache ,
282291 map_parser_config ,
283292 )
0 commit comments