Skip to content

Commit fc19af4

Browse files
committed
examples: http: add get_device_by_id
1 parent c264cc7 commit fc19af4

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

examples/http/get_device_by_id.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import asyncio
2+
import os
3+
4+
import enapter
5+
6+
7+
async def main():
8+
config = enapter.http.api.Config.from_env()
9+
device_id = os.environ["DEVICE_ID"]
10+
async with enapter.http.api.Client(config=config) as client:
11+
device = await client.devices.get(device_id)
12+
print(device)
13+
14+
15+
if __name__ == "__main__":
16+
asyncio.run(main())

0 commit comments

Comments
 (0)