8383 map_content ,
8484 maps ,
8585 network_info ,
86+ obstacle_photos ,
8687 rooms ,
8788 routines ,
8889 smart_wash_params ,
105106from .map_content import MapContentTrait
106107from .maps import MapsTrait
107108from .network_info import NetworkInfoTrait
109+ from .obstacle_photos import ObstaclePhotoTrait
108110from .rooms import RoomsTrait
109111from .routines import RoutinesTrait
110112from .smart_wash_params import SmartWashParamsTrait
131133 "map_content" ,
132134 "maps" ,
133135 "network_info" ,
136+ "obstacle_photos" ,
134137 "rooms" ,
135138 "routines" ,
136139 "smart_wash_params" ,
@@ -171,6 +174,7 @@ class PropertiesApi(Trait):
171174 dust_collection_mode : DustCollectionModeTrait | None = None
172175 wash_towel_mode : WashTowelModeTrait | None = None
173176 smart_wash_params : SmartWashParamsTrait | None = None
177+ obstacle_photos : ObstaclePhotoTrait | None = None
174178
175179 def __init__ (
176180 self ,
@@ -180,6 +184,7 @@ def __init__(
180184 rpc_channel : V1RpcChannel ,
181185 mqtt_rpc_channel : V1RpcChannel ,
182186 map_rpc_channel : V1RpcChannel ,
187+ blob_rpc_channel : V1RpcChannel ,
183188 add_dps_listener : Callable [[Callable [[dict [RoborockDataProtocol , Any ]], None ]], Callable [[], None ]],
184189 web_api : UserWebApiClient ,
185190 device_cache : DeviceCache ,
@@ -191,6 +196,7 @@ def __init__(
191196 self ._rpc_channel = rpc_channel
192197 self ._mqtt_rpc_channel = mqtt_rpc_channel
193198 self ._map_rpc_channel = map_rpc_channel
199+ self ._blob_rpc_channel = blob_rpc_channel
194200 self ._web_api = web_api
195201 self ._device_cache = device_cache
196202 self ._region = region
@@ -229,6 +235,8 @@ def _get_rpc_channel(self, trait: V1TraitMixin) -> V1RpcChannel:
229235 # to use the mqtt_rpc_channel (cloud only) instead of the rpc_channel (adaptive)
230236 if hasattr (trait , "mqtt_rpc_channel" ):
231237 return self ._mqtt_rpc_channel
238+ elif hasattr (trait , "blob_rpc_channel" ):
239+ return self ._blob_rpc_channel
232240 elif hasattr (trait , "map_rpc_channel" ):
233241 return self ._map_rpc_channel
234242 else :
@@ -272,6 +280,11 @@ async def discover_features(self) -> None:
272280 wash_towel_mode ._rpc_channel = self ._get_rpc_channel (wash_towel_mode ) # type: ignore[assignment]
273281 self .wash_towel_mode = wash_towel_mode
274282
283+ if self .obstacle_photos is None and self ._is_supported (ObstaclePhotoTrait , "obstacle_photos" , dock_features ):
284+ obstacle_photos = ObstaclePhotoTrait (self ._rpc_channel )
285+ obstacle_photos ._rpc_channel = self ._get_rpc_channel (obstacle_photos )
286+ self .obstacle_photos = obstacle_photos
287+
275288 # Dynamically create any traits that need to be populated
276289 for item in fields (self ):
277290 if (trait := getattr (self , item .name , None )) is not None :
@@ -283,6 +296,8 @@ async def discover_features(self) -> None:
283296
284297 # Union args may not be in declared order
285298 item_type = union_args [0 ] if union_args [1 ] is type (None ) else union_args [1 ]
299+ if item_type is ObstaclePhotoTrait :
300+ continue
286301 if not self ._is_supported (item_type , item .name , dock_features ):
287302 _LOGGER .debug ("Trait '%s' not supported, skipping" , item .name )
288303 continue
@@ -369,6 +384,7 @@ def create(
369384 rpc_channel : V1RpcChannel ,
370385 mqtt_rpc_channel : V1RpcChannel ,
371386 map_rpc_channel : V1RpcChannel ,
387+ blob_rpc_channel : V1RpcChannel ,
372388 add_dps_listener : Callable [[Callable [[dict [RoborockDataProtocol , Any ]], None ]], Callable [[], None ]],
373389 web_api : UserWebApiClient ,
374390 device_cache : DeviceCache ,
@@ -383,6 +399,7 @@ def create(
383399 rpc_channel ,
384400 mqtt_rpc_channel ,
385401 map_rpc_channel ,
402+ blob_rpc_channel ,
386403 add_dps_listener ,
387404 web_api ,
388405 device_cache ,
0 commit comments