Module to communicate to the EEVEE Mobility API
Project description
aioeeveemobility
Asynchronous library to communicate with the EEVEE Mobility API
API Example
"""Test for aioeeveemobility."""
from aioeeveemobility import EeveeMobilityClient
import asyncio
import json
import aiohttp
async def main():
custom_headers = {
"Timezone": "",
"beta-version": "0",
"App-Version": "28006",
}
client = EeveeMobilityClient(
"user@email.com",
"yourpassword",
custom_headers,
)
try:
user = await client.request("user")
print(f"Hello {user.get('first_name')}")
fleets = await client.request(f"user/{user.get('id')}/fleets")
for fleet in fleets:
for entity in fleet.get('fleet').get('entities'):
if entity.get('id') == fleet.get('entity_id'):
break
print(f"Fleet: {fleet.get('fleet').get('name')}, {entity.get('name')} | Payout rate: {fleet.get('payout_rate').get('rate')} {fleet.get('payout_rate').get('currency_code')} {fleet.get('payout_rate').get('suffix')}")
cars = await client.request(f"cars")
for car in cars:
print(f"Your car: {car.get('display_name')} {car.get('license')}")
addresses = await client.request(f"cars/{car.get('id')}/addresses")
print("Addresses:")
for address in addresses:
print(f" > {address.get('name')}: {address.get('location')}")
events = await client.request(f"cars/{car.get('id')}/events")
print("Events:")
for event in events.get('data'):
print(event)
finally:
await client.close_session()
asyncio.run(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
aioeeveemobility-0.1.0.tar.gz
(4.6 kB
view hashes)
Built Distribution
Close
Hashes for aioeeveemobility-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c3574c16b0953e792131662cdfd99255216b0ebfdd77682946228607fd0fa9b |
|
MD5 | 2b391d072b8dc539bf3b9d300116b211 |
|
BLAKE2b-256 | 39f873db9916121907c641a808bc1abcbb7ad743dde5b10371588614f55af06d |