Reputation: 180
I am needing to use the LIRC Python client bindings for a project. The LIRC website has good documentation over them, but I have no idea how to actually get them besides copying and pasting the python code. It never says anywhere on the site that I have seen where to actually get them.
Where/how do I get these bindings?
http://www.lirc.org/html/lirc_client.html
http://www.lirc.org/api-docs/html/group__python__bindings.html
Upvotes: 2
Views: 667
Reputation: 42615
On Debian/Raspbian you only need lirc
package. It contains the lirc Python bindings package sources unpacked and as tar.gz file.
You can install the lirc Python bindings to a currently active venv is for example by this command:
pip3 install /usr/share/lirc/lirc-0.10.1.tar.gz
The command above works for Raspbian GNU/Linux 12 (bookworm), for your Linux distribution and lirc version you may have to adapt it.
Test scripts for testing functionality of lirc python bindings:
import lirc
print(lirc.get_default_socket_path())
Outputs /var/run/lirc/lircd
with lirc.RawConnection('/var/run/lirc/lircd') as conn:
press = conn.readline()
print(press)
If you omit the parameter '/var/run/lirc/lircd'
the default socket path printed by example 1 is used.
import lirc
with lirc.LircdConnection('mylirc') as conn:
while True:
string = conn.readline()
print(string)
The 'mylirc'
argument is taken form /etc/lirc/lircrc
where each key is defined. It is there defined as prog = mylirc
in each begin/end block.
Upvotes: 0
Reputation: 149
You could install the latest version available on the upstream site: http://sf.net/p/lirc. This is the version actually described in the docs. The pypi described in previous reply is another beast.
Upvotes: 0
Reputation: 22952
I think you need to install python-lirc or python3-lirc available on PyPi.
This is a Python binding to LIRC.
Upvotes: 0