Skip to content

Commit

Permalink
add a test file for running a serial interface
Browse files Browse the repository at this point in the history
  • Loading branch information
glibersat committed Jun 29, 2011
1 parent f9cdcb4 commit 8a23406
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/test_serial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import logging

from x10.controllers.cm17a import CM17a

logger = logging.getLogger()
hdlr = logging.StreamHandler() # Console
formatter = logging.Formatter('%(module)s - %(asctime)s %(levelname)s %(message)s')
hdlr.setFormatter(formatter)
logger.addHandler(hdlr)
logger.setLevel(logging.DEBUG)

dev = CM17a('/dev/ttyUSB')
dev.open()

livinglamp = dev.actuator("A1")

livinglamp.on()

dev.close()






0 comments on commit 8a23406

Please sign in to comment.