Skip to content

Commit 4204bf3

Browse files
committed
http: api: devices: add slug to standalone provisioning request
1 parent 301814d commit 4204bf3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/enapter/http/api/devices/client.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,13 @@ class Client:
1616
def __init__(self, client: httpx.AsyncClient) -> None:
1717
self._client = client
1818

19-
async def create_standalone(self, name: str, site_id: str | None = None) -> Device:
19+
async def create_standalone(
20+
self, name: str, site_id: str | None = None, slug: str | None = None
21+
) -> Device:
2022
url = "v3/provisioning/standalone"
21-
response = await self._client.post(url, json={"slug": name, "site_id": site_id})
23+
response = await self._client.post(
24+
url, json={"name": name, "site_id": site_id, "slug": slug}
25+
)
2226
api.check_error(response)
2327
return await self.get(device_id=response.json()["device_id"])
2428

0 commit comments

Comments
 (0)