File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -332,6 +332,29 @@ async def get_home_data_v2(self, user_data: UserData) -> HomeData:
332332 else :
333333 raise RoborockException ("home_response result was an unexpected type" )
334334
335+ async def get_home_data_v3 (self , user_data : UserData ) -> HomeData :
336+ """This is the same as get_home_data, but uses a different endpoint and includes non-robotic vacuums."""
337+ rriot = user_data .rriot
338+ if rriot is None :
339+ raise RoborockException ("rriot is none" )
340+ home_id = await self ._get_home_id (user_data )
341+ if rriot .r .a is None :
342+ raise RoborockException ("Missing field 'a' in rriot reference" )
343+ home_request = PreparedRequest (
344+ rriot .r .a ,
345+ {
346+ "Authorization" : self ._get_hawk_authentication (rriot , "/v3/user/homes/" + str (home_id )),
347+ },
348+ )
349+ home_response = await home_request .request ("get" , "/v3/user/homes/" + str (home_id ))
350+ if not home_response .get ("success" ):
351+ raise RoborockException (home_response )
352+ home_data = home_response .get ("result" )
353+ if isinstance (home_data , dict ):
354+ return HomeData .from_dict (home_data )
355+ else :
356+ raise RoborockException ("home_response result was an unexpected type" )
357+
335358 async def get_rooms (self , user_data : UserData , home_id : int | None = None ) -> list [HomeDataRoom ]:
336359 rriot = user_data .rriot
337360 if rriot is None :
You can’t perform that action at this time.
0 commit comments