Asynchronous Python client for the weenect API
Project description
aioweenect
Asynchronous Python client for the weenect API
Installation
$ pip install aioweenect
Usage
from aioweenect import AioWeenect
import asyncio
USER = "<YOUR_USER>"
PASSWORD = "<YOUR_PASSWORD>"
async def main():
"""Show example how to get location of your tracker."""
async with AioWeenect(username=USER, password=PASSWORD) as aioweenect:
trackers_response = await aioweenect.get_trackers()
tracker_id = trackers_response["items"][0]["id"]
tracker_name = trackers_response["items"][0]["name"]
position_response = await aioweenect.get_position(tracker_id=tracker_id)
lat = position_response[0]["latitude"]
lon = position_response[0]["longitude"]
last_message = position_response[0]["last_message"]
print(
f"Location for {tracker_name}: lat: {lat}, lon: {lon}. Last message received: {last_message}"
)
if __name__ == "__main__":
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
aioweenect-1.1.5.tar.gz
(15.9 kB
view details)
Built Distribution
File details
Details for the file aioweenect-1.1.5.tar.gz
.
File metadata
- Download URL: aioweenect-1.1.5.tar.gz
- Upload date:
- Size: 15.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e9ba1434a9b9a66fdc6bef605c8c993cbe4c875cc09aafc98509b50370d5fcf |
|
MD5 | 5f227c159f6e26363467555be4aa872f |
|
BLAKE2b-256 | c3cedfc755cc64e5ff08325e953694ece91058a0605eec76a1adb044f500c453 |
File details
Details for the file aioweenect-1.1.5-py3-none-any.whl
.
File metadata
- Download URL: aioweenect-1.1.5-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a39295e7e91b957c099227a2fc33e83aa46a0ff4bbbed57254ab6751979e82c |
|
MD5 | 1c300c818e10bb4018e3f7d386e44572 |
|
BLAKE2b-256 | 5986f1f6140dfba96a55c96ed3e7c1eb4926aaa323db7381480c3f1b0d26883b |