From 2620a886ee4a9a762277e80243020924357f16f9 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Sat, 3 Oct 2026 10:44:01 +0000 Subject: [PATCH] Document the SKY, the cloud client and streaming in the README The README only described controlling a LaMetric TIME on the local network. It now mentions the SKY, shows a short cloud example, and links the streaming example. The usage example imported a few enums from demetriek.models, which only worked because that module happens to import them. It now imports everything from the package itself. --- README.md | 44 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 39 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 8d9f6ead..1eb8a635 100644 --- a/README.md +++ b/README.md @@ -15,14 +15,21 @@ [![Support Frenck on Patreon][patreon-shield]][patreon] -Asynchronous Python client for LaMetric TIME devices. +Asynchronous Python client for LaMetric TIME and SKY devices. ## About -This package allows you to control and monitor an LaMetric TIME device +This package allows you to control and monitor LaMetric TIME and SKY devices programmatically, directly on your local network. It is mainly created to allow third-party programs to automate the behavior of the LaMetric device. +Besides the local device API, it can: + +- Talk to the LaMetric cloud, to list the devices on your account, including + their local IP address and API key. +- Stream frames straight to the screen of the device, see + [`examples/stream.py`](examples/stream.py). + ## Installation ```bash @@ -36,11 +43,11 @@ pip install demetriek import asyncio -from demetriek import LaMetricDevice -from demetriek.models import ( +from demetriek import ( + Chart, Goal, GoalData, - Chart, + LaMetricDevice, Model, Notification, NotificationIconType, @@ -86,6 +93,33 @@ async def main(): await lametric.notify(notification=notification) +if __name__ == "__main__": + asyncio.run(main()) +``` + +### Cloud + +The cloud client needs an OAuth2 access token for your LaMetric developer +account. + +```python +"""Asynchronous Python client for LaMetric TIME devices.""" + +import asyncio + +from demetriek import LaMetricCloud + + +async def main(): + """List the LaMetric devices on your account.""" + async with LaMetricCloud(token="oauth2_access_token") as cloud: + user = await cloud.current_user() + print(f"Hi {user.name}, you have these devices:") + + for device in await cloud.devices(): + print(f"- {device.name} at {device.ip}") + + if __name__ == "__main__": asyncio.run(main()) ```