A clone of: https://github.com/nutechsoftware/alarmdecoder This is requires as they dropped support for older firmware releases w/o building in backward compatibility code, and they had previously hardcoded pyserial to a python2 only version.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
1.8 KiB

  1. .. alarmdecoder documentation master file, created by
  2. sphinx-quickstart on Sat Jun 8 14:38:46 2013.
  3. You can adapt this file completely to your liking, but it should at least
  4. contain the root `toctree` directive.
  5. Welcome to Alarm Decoder's documentation!
  6. =========================================
  7. .. _Alarm Decoder: http://www.alarmdecoder.com
  8. .. _examples: http://github.com/nutechsoftware/alarmdecoder/tree/master/examples
  9. 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.
  10. The source code, requirements and examples for this project may be found `here <http://github.com/nutechsoftware/alarmdecoder>`_.
  11. Please see the `examples`_ directory for more samples, but a basic one is included below::
  12. import time
  13. from alarmdecoder import AlarmDecoder
  14. from alarmdecoder.devices import USBDevice
  15. def main():
  16. """
  17. Example application that prints messages from the panel to the terminal.
  18. """
  19. try:
  20. # Retrieve the first USB device
  21. device = AlarmDecoder(USBDevice.find())
  22. # Set up an event handler and open the device
  23. device.on_message += handle_message
  24. with device.open():
  25. while True:
  26. time.sleep(1)
  27. except Exception, ex:
  28. print 'Exception:', ex
  29. def handle_message(sender, message):
  30. """
  31. Handles message events from the AlarmDecoder.
  32. """
  33. print sender, message.raw
  34. if __name__ == '__main__':
  35. main()
  36. Table of Contents:
  37. .. toctree::
  38. :maxdepth: 4
  39. alarmdecoder
  40. Indices and tables
  41. ==================
  42. * :ref:`genindex`
  43. * :ref:`modindex`
  44. * :ref:`search`