drothlis/stb-tester — pull request #9 by szemate (2013-04-18 18:23:42+00:00)
Title: stbt.py: Support multiple lirc devices connected to the same host

To use multiple LIRC devices connected to the same host:

(1) Stop `lirc` service.

(2) Run multiple `lircd` instances, and set the TCP ports that each
device listens to:
`sudo lircd --device=/dev/lirc0 --pidfile=/var/run/lirc/lirc0.pid
--listen=8765 --output=/var/run/lirc/lircd`
`sudo lircd --device=/dev/lirc1 --pidfile=/var/run/lirc/lirc1.pid
--listen=8766 --output=/var/run/lirc/lircd`

`lirc0` and `lirc1` can be addressed individually using the assigned TCP
ports; but both send the received key codes to `/var/run/lirc/lircd`
therefore any of the two can be used as 'control_recorder'.

(3) Send keys the same way as to a Virtual Remote but with LIRC command
strings:
`echo -e "SEND_ONCE humax MENU" | nc localhost 8765`
It's also possible to output keys via a LIRC device of a remote computer.

To put both remotes into use by stb-tester, all we need is a new remote
type with "hostname", "port" and "remote_control_name" parameters that
uses 'VirtualRemote._connect()' to connect and 'LircRemote.press(key)'
to send keys.