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
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.0.tar.gz
(15.2 kB
view hashes)
Built Distribution
Close
Hashes for aioweenect-1.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 467ed799453d10445a44d4fd7d7d4859d7d2347b9a7066e95b09d43bc743dac1 |
|
MD5 | 7aa78cd80d36baa0981d79e308d80ad8 |
|
BLAKE2b-256 | 35eb43fcab08e958dfe3ee9e4de79829f196a7f47c5a7547c600a6db10c2b9c3 |