Wrapper around alarmdecoder to make it Twisted compatible.
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.
 
 
John-Mark Gurney a37b25c6e0 pull in dep that has fixed setup.py 2 years ago
.gitignore ignore some standard files 7 years ago
Makefile update to Python 3... 3 years ago
README.md add a README w/ a sample on running w/ twisted. 7 years ago
adtwist.py drop debugging print.. 3 years ago
requirements.txt move the requirements.txt into setup.py so they match.. 2 years ago
setup.py pull in dep that has fixed setup.py 2 years ago

README.md

adtwist

This is a wrapper around the python module alarmdecoder that makes it compatible w/ the twisted framework. This replaces the included device so that you don’t have to use a thread to handle I/O from the device.

Currently it is only tested w/ a AD2USB via a serial port. There is no USB auto detect code included.

Sample Usage

Sample code:

from adtwist import adtwist
from twisted.internet import reactor

def msgcbfun(ad, message):
	print 'received msg:', `message`

ad = adtwist('/dev/ttyU1', baudrate=115200)
ad.on_message += msgcbfun

reactor.run()

This will create an AlarmDecoder instance (from alarmdecoder) and attach it to the device /dev/ttyU1. It will print each message received from the device.