Skip to main content

Python interface for the AlarmDecoder (AD2) family of alarm devices which includes the AD2USB, AD2SERIAL and AD2PI.

Project description

https://travis-ci.org/nutechsoftware/alarmdecoder.svg?branch=master

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:

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

alarmdecoder-1.13.9.tar.gz (313.7 kB view details)

Uploaded Source

File details

Details for the file alarmdecoder-1.13.9.tar.gz.

File metadata

  • Download URL: alarmdecoder-1.13.9.tar.gz
  • Upload date:
  • Size: 313.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.8.1 pkginfo/1.2.1 requests/2.12.4 setuptools/42.0.2 requests-toolbelt/0.7.0 clint/0.5.1 CPython/3.5.3 Linux/4.19.0-5-amd64

File hashes

Hashes for alarmdecoder-1.13.9.tar.gz
Algorithm Hash digest
SHA256 04ddb45fb8095ded0ca90580eff42b6b5072643cfa2f443923e34238920c5f46
MD5 a46ac8ea376573a8fc8d669514246df0
BLAKE2b-256 e01ca37c19c4b8d2b46e9cb5c7594b64bc09a32b2e34526ec743a1d86a55baec

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page