Welcome to Alarm Decoder’s documentation! — alarmdecoder documentation

### Navigation

- index
- modules |
- next |
- alarmdecoder documentation »

# Welcome to Alarm Decoder’s documentation!

This is the API documentation for the Alarm Decoder Python library. It provides support for interacting with the Alarm Decoder (AD2) family of security alarm devices, including the AD2USB, AD2SERIAL and AD2PI.

The source code, requirements and examples for this project may be found here.

Please see the examples directory for more samples, but a basic one is included below:

    import time
    from alarmdecoder import AlarmDecoder
    from alarmdecoder.devices import USBDevice

    def main():
        """
        Example application that prints messages from the panel to the terminal.
        """
        try:
            # Retrieve the first USB device
            device = AlarmDecoder(USBDevice.find())

            # Set up an event handler and open the device
            device.on_message += handle_message
            with device.open():
                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()

Table of Contents:

- alarmdecoder Package
  - `decoder` Module
  - `devices` Module
  - `messages` Module
  - `zonetracking` Module
  - `util` Module
  - `panels` Module

# Indices and tables

- Index
- Module Index
- Search Page

### Navigation

- index
- modules |
- next |
- alarmdecoder documentation »