Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 39 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down Expand Up @@ -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())
```
Expand Down
Loading