Python interface for the AlarmDecoder (AD2) family of alarm devices which includes the AD2USB, AD2SERIAL and AD2PI.
Project description
Summary
This Python library aims to provide a consistent interface for the AlarmDecoder product line. (AD2USB, AD2SERIAL and AD2PI). This also includes devices that have been exposed via ser2sock, which supports encryption via SSL/TLS.
Installation
AlarmDecoder can be installed through pip:
pip install alarmdecoder
or from source:
python setup.py install
Note: python-setuptools is required for installation.
Requirements
Required:
An AlarmDecoder device
Python 2.7
pyserial >= 2.7
Optional:
Documentation
API documentation can be found at readthedocs.
Examples
A basic example is included below. Please see the examples directory for more.:
import time
from alarmdecoder import AlarmDecoder
from alarmdecoder.devices import SerialDevice
def main():
"""
Example application that prints messages from the panel to the terminal.
"""
try:
# Retrieve the first USB device
device = AlarmDecoder(SerialDevice(interface='/dev/ttyUSB0'))
# Set up an event handler and open the device
device.on_message += handle_message
with device.open(baudrate=115200):
while True:
time.sleep(1)
except Exception as ex:
print ('Exception:', ex)
def handle_message(sender, message):
"""
Handles message events from the AlarmDecoder.
"""
print sender, message.raw
if __name__ == '__main__':
main()
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file alarmdecoder-1.13.14.tar.gz.
File metadata
- Download URL: alarmdecoder-1.13.14.tar.gz
- Upload date:
- Size: 324.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b0713c75f694650af5007bf78fad5e1fc4c344d60e842e6941b020db0b52933e
|
|
| MD5 |
f3f5a16aad76505d532e2a3faea8a7f6
|
|
| BLAKE2b-256 |
b00e0f2b379e812519e9e765c49011f2d6d1ef17b259f96b8b34e664b6866ea5
|
File details
Details for the file alarmdecoder-1.13.14-py2.py3-none-any.whl.
File metadata
- Download URL: alarmdecoder-1.13.14-py2.py3-none-any.whl
- Upload date:
- Size: 48.6 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5eb12a53093b44df084d270f600c178ee24681134c67b6a9ecee0c453784463
|
|
| MD5 |
2ed275fb8c09f74af4d6b03c943c2772
|
|
| BLAKE2b-256 |
6007fc3c5a5e642d25d126cc14b357c1e14273b30192b733656504eaaf04647e
|