New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

alarmdecoder

Package Overview
Dependencies
Maintainers
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

alarmdecoder

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

  • 1.13.12
  • PyPI
  • Socket score

Maintainers
2

.. _AlarmDecoder: http://www.alarmdecoder.com .. _ser2sock: http://github.com/nutechsoftware/ser2sock .. _pyftdi: https://github.com/eblot/pyftdi .. _pyusb: http://sourceforge.net/apps/trac/pyusb .. _pyserial: http://pyserial.sourceforge.net .. _pyopenssl: https://launchpad.net/pyopenssl .. _readthedocs: http://alarmdecoder.readthedocs.org .. _examples: http://github.com/nutechsoftware/alarmdecoder/tree/master/examples

============ AlarmDecoder

.. image:: https://travis-ci.org/nutechsoftware/alarmdecoder.svg?branch=master :target: https://travis-ci.org/nutechsoftware/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 as ex:
        print ('Exception:', ex)

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

if __name__ == '__main__':
    main()

Keywords

FAQs


Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc