https://github.com/eifinger/aioweenect
Asynchronous Python client for the weenect API
https://github.com/eifinger/aioweenect
aiohttp python python3 weenect weenect-api
Last synced: 28 days ago
JSON representation
Asynchronous Python client for the weenect API
- Host: GitHub
- URL: https://github.com/eifinger/aioweenect
- Owner: eifinger
- License: mit
- Created: 2021-04-15T13:55:21.000Z (about 4 years ago)
- Default Branch: main
- Last Pushed: 2024-08-07T14:24:45.000Z (9 months ago)
- Last Synced: 2025-03-22T11:51:11.319Z (about 1 month ago)
- Topics: aiohttp, python, python3, weenect, weenect-api
- Language: Python
- Homepage:
- Size: 613 KB
- Stars: 4
- Watchers: 5
- Forks: 2
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# aioweenect
Asynchronous Python client for the weenect API
[](https://github.com/eifinger/aioweenect/actions?workflow=CI)
[](https://pypi.python.org/pypi/aioweenect)
[](https://github.com/eifinger/aioweenect/blob/master/LICENSE)
[](https://codecov.io/gh/eifinger/aioweenect)
[](https://pepy.tech/project/aioweenect)## Installation
```bash
$ pip install aioweenect
```## Usage
```python
from aioweenect import AioWeenectimport asyncio
USER = ""
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())
```