Home Assistant Python 3 API wrapper for MovingIntelligence
Project description
Python: Moving Intelligence
Home Assistant Python 3 API wrapper for Moving Intelligence asset and fleet management
About
This package allows the Home Assistant integration 'moving_intelligence' to get get data from https://movingintelligence.com/en/.
NOTE: You need a login account together with an apikey to be able to use it.
Installation
pip3 install pymovingintelligence_ha
Example code
#!/usr/bin/env python3
from pymovingintelligence_ha import MovingIntelligence, InvalidAuthError, InvalidPermissionsError
import logging
import sys
import json
import time
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.DEBUG)
try:
## Init
# Initialize API client with your login name and apikey
api = MovingIntelligence(
username="YOUR USERNAME",
apikey="YOUR APIKEY",
)
try:
devices = api.get_devices()
for device in devices:
print(device.state_attributes)
except InvalidAuthError:
logger.debug("Authenticaton error, your username and/or apikey is invalid.")
except InvalidPermissionsError:
logger.error("No permission to access this data")
except requests.exceptions.ConnectionError:
logger.error("ConnectionError: Could not connect to MovingIntelligence")
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
Close
Hashes for pymovingintelligence_ha-0.0.10.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2477d58a5056c9c705ceb1a18418c20c8700ba489a09588faec2a65c3d992f3a |
|
MD5 | d94978d717a2e6bcd0c6cfb8cc25ab7e |
|
BLAKE2b-256 | 5885baa8e52f5daef27908db4c75fb108dc521d50cac1b2b2a4da247715c3a15 |