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.

66 lines
1.9 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. .. _AD2USB: http://www.alarmdecoder.com
  9. .. _AD2SERIAL: http://www.alarmdecoder.com
  10. .. _AD2PI: http://www.alarmdecoder.com
  11. .. _examples: http://github.com/nutechsoftware/alarmdecoder/tree/master/examples
  12. 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`_.
  13. The source code, requirements and examples for this project may be found `here <http://github.com/nutechsoftware/alarmdecoder>`_.
  14. Please see the `examples`_ directory for more samples, but a basic one is included below::
  15. import time
  16. from alarmdecoder import AlarmDecoder
  17. from alarmdecoder.devices import USBDevice
  18. def main():
  19. """
  20. Example application that prints messages from the panel to the terminal.
  21. """
  22. try:
  23. # Retrieve the first USB device
  24. device = AlarmDecoder(USBDevice.find())
  25. # Set up an event handler and open the device
  26. device.on_message += handle_message
  27. with device.open():
  28. while True:
  29. time.sleep(1)
  30. except Exception, ex:
  31. print 'Exception:', ex
  32. def handle_message(sender, message):
  33. """
  34. Handles message events from the AlarmDecoder.
  35. """
  36. print sender, message.raw
  37. if __name__ == '__main__':
  38. main()
  39. Table of Contents:
  40. .. toctree::
  41. :maxdepth: 4
  42. alarmdecoder
  43. Indices and tables
  44. ==================
  45. * :ref:`genindex`
  46. * :ref:`modindex`
  47. * :ref:`search`