From b40f3d0e0f74e623a1d29a238b65c11ea1981d0e Mon Sep 17 00:00:00 2001 From: Allen Porter Date: Thu, 18 Sep 2025 06:57:55 -0700 Subject: [PATCH] fix: Pass through additional fields to the home data fetcher --- roborock/devices/device_manager.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/roborock/devices/device_manager.py b/roborock/devices/device_manager.py index b787ef91..845f4982 100644 --- a/roborock/devices/device_manager.py +++ b/roborock/devices/device_manager.py @@ -5,6 +5,8 @@ import logging from collections.abc import Awaitable, Callable +import aiohttp + from roborock.code_mappings import RoborockCategory from roborock.containers import ( HomeData, @@ -113,7 +115,9 @@ async def close(self) -> None: await asyncio.gather(*tasks) -def create_home_data_api(email: str, user_data: UserData) -> HomeDataApi: +def create_home_data_api( + email: str, user_data: UserData, base_url: str | None = None, session: aiohttp.ClientSession | None = None +) -> HomeDataApi: """Create a home data API wrapper. This function creates a wrapper around the Roborock API client to fetch @@ -122,7 +126,7 @@ def create_home_data_api(email: str, user_data: UserData) -> HomeDataApi: # Note: This will auto discover the API base URL. This can be improved # by caching this next to `UserData` if needed to avoid unnecessary API calls. - client = RoborockApiClient(email) + client = RoborockApiClient(username=email, base_url=base_url, session=session) async def home_data_api() -> HomeData: return await client.get_home_data_v3(user_data)