Get alarm status and informations from the IMA Protect API.
Project description
pyimaprotect - Python IMA Protect Alarm UNOFFICIAL
This work is originally developed for use with Home Assistant and the custom component imaprotect.
Free software: MIT license
Documentation: https://pyimaprotect.readthedocs.io.
Features
Since the last update of IMAProtect “API” (05/2021), this plugin allows you to:
get the status of your alarm:
from pyimaprotect import IMAProtect, STATUS_NUM_TO_TEXT
ima = IMAProtect('myusername','mysuperpassword')
print("# Get Status")
imastatus = ima.status
print("Current Alarm Status: %d (%s)" % (imastatus,STATUS_NUM_TO_TEXT[imastatus]))
set the status of your alarm:
from pyimaprotect import IMAProtect
ima = IMAProtect('myusername','mysuperpassword')
print("# Set Status")
ima.status = 0 # 0 to OFF, 1 to PARTIAL and 2 to On
get the list and information of your registered contacts:
from pyimaprotect import IMAProtect
ima = IMAProtect('myusername','mysuperpassword')
print("# Get Contact List")
contact_list = ima.get_contact_list()
for contact in contact_list:
print(contact)
download the images/photos taken with your connected elements:
from pyimaprotect import IMAProtect
ima = IMAProtect('myusername','mysuperpassword')
print("# Download Images")
ima.download_images() # Download images to 'Images/' folder. One subfolder per camera.
ima.download_images("MyImages/") # Download images to a defined directory 'MyImages/' folder.
Parameters
username: Username used to connect to https://www.imaprotect.com/
password: Password used to connect to https://www.imaprotect.com/
Methods
status: property to get or set the status of your IMA Protect Alarm. See the next table to understand the values.
get_contact_list: get a JSON with the list and information about your registered contacts.
download_images: download the images/photos taken with your connected elements.
Alarm Value |
State |
---|---|
-1 |
UNKNOWN |
0 |
OFF |
1 |
PARTIAL |
2 |
ON |
Credits
History
3.0.0 (2021-05-22)
Add option to change the alarm (set/get)
Add function to get the list of contacts
Add function to download the images
get_status has been removed, status is now a property to get/set the alarm.
2.0.0 (2021-05-09)
Update using new IMAProtect “API”
No more other info (name, contract, etc.), only alarm status but faster result.
1.0.0 (2021-04-11)
First release on PyPI.
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
Built Distribution
Hashes for pyimaprotect-3.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca67df8c3faa2a1c5cf2564ab6c78bc5fe5f9c25ab797c5c4aff7b417b8fc5f1 |
|
MD5 | a6707eff9886e6d661467f0a8fd42c52 |
|
BLAKE2b-256 | efc99db6bf9c7d9ca99711ccdc1a9933ea89748b326e4fd352cc2055442a9335 |