Skip to content

Commit 98ea911

Browse files
lboueallenporter
andauthored
feat: update cli.py and device_manager.py to use get_home_data_v3 (#418)
* feat: get_home_data_v3 for new devices Use get_home_data_v3 to discovered Roborock Q10 devices Update device_manager.py to use get_home_data_v3 * feat: Use get_home_data_v3 for tests * chore: fix merge with cache data rename --------- Co-authored-by: Allen Porter <[email protected]>
1 parent a385a14 commit 98ea911

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

roborock/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ async def _discover(ctx):
163163
if not cache_data:
164164
raise Exception("You need to login first")
165165
client = RoborockApiClient(cache_data.email)
166-
home_data = await client.get_home_data(cache_data.user_data)
166+
home_data = await client.get_home_data_v3(cache_data.user_data)
167167
cache_data.home_data = home_data
168168
context.update(cache_data)
169169
click.echo(f"Discovered devices {', '.join([device.name for device in home_data.get_all_devices()])}")

roborock/devices/device_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def create_home_data_api(email: str, user_data: UserData) -> HomeDataApi:
120120
client = RoborockApiClient(email)
121121

122122
async def home_data_api() -> HomeData:
123-
return await client.get_home_data(user_data)
123+
return await client.get_home_data_v3(user_data)
124124

125125
return home_data_api
126126

tests/devices/test_device_manager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ async def home_data_api_exception() -> HomeData:
9393
async def test_create_home_data_api_exception() -> None:
9494
"""Test that exceptions from the home data API are propagated through the wrapper."""
9595

96-
with patch("roborock.devices.device_manager.RoborockApiClient.get_home_data") as mock_get_home_data:
96+
with patch("roborock.devices.device_manager.RoborockApiClient.get_home_data_v3") as mock_get_home_data:
9797
mock_get_home_data.side_effect = RoborockException("Test exception")
9898
api = create_home_data_api(USER_DATA, mock_get_home_data)
9999

0 commit comments

Comments
 (0)