Giter VIP home page Giter VIP logo

alarmdecoder's Introduction

AlarmDecoder

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: * pyftdi >= 0.9.0 * pyusb >= 1.0.0b1 * pyopenssl

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, ex:
        print 'Exception:', ex

def handle_message(sender, message):
    """
    Handles message events from the AlarmDecoder.
    """
    print sender, message.raw

if __name__ == '__main__':
    main()

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.