Skip to content

Commit

Permalink
🚑 Fix getting devices from LaMetric Cloud (#196)
Browse files Browse the repository at this point in the history
  • Loading branch information
frenck committed Aug 12, 2022
1 parent f7542e2 commit 87159d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/demetriek/cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ async def devices(self) -> list[CloudDevice]:
Returns:
A list of CloudDevices.
"""
response = await self._request("/api/v2/me/devices")
response = await self._request("/api/v2/users/me/devices")
return parse_obj_as(list[CloudDevice], response)

async def device(self, device_id: int) -> CloudDevice:
Expand All @@ -119,7 +119,7 @@ async def device(self, device_id: int) -> CloudDevice:
Returns:
A CloudDevice object, with information about the request device.
"""
response = await self._request(f"/api/v2/me/devices/{device_id}")
response = await self._request(f"/api/v2/users/me/devices/{device_id}")
return CloudDevice.parse_obj(response)

async def close(self) -> None:
Expand Down
4 changes: 2 additions & 2 deletions tests/test_cloud.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ async def test_get_devices(aresponses: ResponsesMockServer) -> None:
"""Test getting devices from the logged in account."""
aresponses.add(
"developer.lametric.com",
"/api/v2/me/devices",
"/api/v2/users/me/devices",
"GET",
aresponses.Response(
status=200,
Expand Down Expand Up @@ -249,7 +249,7 @@ async def test_get_device(aresponses: ResponsesMockServer) -> None:
"""Test getting a specific device from the logged in account."""
aresponses.add(
"developer.lametric.com",
"/api/v2/me/devices/42",
"/api/v2/users/me/devices/42",
"GET",
aresponses.Response(
status=200,
Expand Down

0 comments on commit 87159d2

Please sign in to comment.