Menu ▾ ▴

#1 support named serial ports, e.g. /dev/ttyUSB0

Unstable_(example)
closed
None
5
2015-01-22
2010-08-07
Brad Fritz
No

Add support for named serial ports, e.g.
p = pylights.plm('/dev/ttyUSB0')

My python is pretty weak so if you decide to apply the patch, please feel free
to tweak it however you like first.

Discussion

  • Brad Fritz

    Brad Fritz - 2010-08-07

    support named serial ports

     
  • Brad Fritz

    Brad Fritz - 2010-08-07
    • summary: support --> support named serial ports
     
  • Brad Fritz

    Brad Fritz - 2010-08-07
    • summary: support named serial ports --> support named serial ports, e.g. /dev/ttyUSB0
     
  • Bryon Bridges

    Bryon Bridges - 2010-08-11
    • status: open --> closed-accepted
     
  • Bryon Bridges

    Bryon Bridges - 2010-08-11

    Thanks Brad.
    The new version is in the repository. I have no convenient way of testing this so if you don't mind...

     
  • Brad Fritz

    Brad Fritz - 2010-08-11
    • status: closed-accepted --> open-accepted
     
  • Brad Fritz

    Brad Fritz - 2010-08-11

    Bryon, thank you for incorporating the change. Works great!

    I tested by replacing my patched pylights.py with your latest
    version (SVN r2) and issuing a few commands in the REPL:

    brad@sheevaplug:/tmp/insteon$ python
    Python 2.6.5+ (release26-maint, Jul 7 2010, 00:21:05)
    [GCC 4.4.4] on linux2
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import pylights
    >>> pylights.device_cfg_filename = './devices.xml'
    >>> p = pylights.plm('/dev/ttyUSB0')
    >>> p.setLevel('test_lamp', 100)
    'OK'

    [lamp turns on]

    >>> p.setLevel('test_lamp', 0)
    'OK'

    [lamp turns off]

    Also, judging by serialwin32.py in pySerial, you should be able
    to use:

    pylights.plm('COM1')

    in place of:

    pylights.plm(0)

    to test on Win32 platforms. YMMV though; I have not tested that
    yet and I may be mis-reading the pySerial source code.

    Thanks again!

    --Brad

     
  • Bryon Bridges

    Bryon Bridges - 2015-01-22
    • status: open-accepted --> closed
    • assigned_to: Bryon Bridges
    • Group: --> Unstable_(example)
     

Log in to post a comment.