lirc的irsend的一个简单包装器。
py-irsend的Python项目详细描述
python irsend
这是一个简单的lirc's irsend包装器
安装:
pip install py_irsend
基本用法:
>>> from py_irsend import irsend
>>> irsend.list_remotes()
['lasko_heater', 'lights.conf', 'dynex_tv', 'logitech_z906', 'sabrent_hdmi_switch']
>>> irsend.list_codes('logitech_z906')
['POWER', 'INPUT', 'MUTE', 'LEVEL', 'EFFECT', 'VOLUME_DOWN', 'VOLUME_UP']
>>> irsend.send_once('logitech_z906', ['POWER'])
它利用subprocess 打电话给欧文。没有尝试处理错误(例如,irsend没有 已安装,或者lircd未运行),而是将其留给调用方。见 子流程的文档(特别是 check_output) 以确定可能引发的异常