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.11.tar.gz (314.9 kB view details)

Uploaded Source

Built Distribution

alarmdecoder-1.13.11-py3-none-any.whl (48.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: alarmdecoder-1.13.11.tar.gz
  • Upload date:
  • Size: 314.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.1

File hashes

Hashes for alarmdecoder-1.13.11.tar.gz
Algorithm Hash digest
SHA256 61cad87c1fe2d8dda599844c081d43a5ada691eae0485b3307e856a48b5e3a65
MD5 10f268171a97c8d2917d95b0c7b70dc4
BLAKE2b-256 9391aaab0ff2148f97e94162cc7d74f016977414cb8e80e611834d1a596ab5c2

See more details on using hashes here.

File details

Details for the file alarmdecoder-1.13.11-py3-none-any.whl.

File metadata

  • Download URL: alarmdecoder-1.13.11-py3-none-any.whl
  • Upload date:
  • Size: 48.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/52.0.0.post20210125 requests-toolbelt/0.9.1 tqdm/4.57.0 CPython/3.9.1

File hashes

Hashes for alarmdecoder-1.13.11-py3-none-any.whl
Algorithm Hash digest
SHA256 cae54c339a40ec3be831ea7ca204c8f1696af215438c89c783421dbfa5838d47
MD5 50836ff4739428d20bf5ec8496adaa44
BLAKE2b-256 f094a2f382b2495bd10a12c128af602f59431dfbd6425334f3f9b455e60d6b71

See more details on using hashes here.

Supported by

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