Samsumgs机顶盒SMT-G7400和SMT-G7401的API包装。
einder的Python项目详细描述
E下
eInder是用于机顶盒SMT C7400和SMT C7401的API包装器。 在荷兰,这些盒子是由荷兰一家大型有线电视运营商出售的。 在“地平线”框下。Einder这个名字是荷兰语的同义词 地平线。
我要感谢他 在horizoncontrol上工作。 这只是无耻的Python抢劫。
安装
$ pip install einder
使用量
einder.Client通过发送字节来控制机顶盒。这些字节 表示遥控器的按钮。你可以找到所有支持的 在einder.keys中键入。这个例子展示了如何 发送密钥。
importtimeimportloggingfromeinderimportClientfromeinderimportkeys# Enable logging.logging.basicConfig(level=logging.DEBUG)# Replace IP with the IP of your set-top box. The port parameter is optional,# by default its 5900.c=Client("192.168.1.245",port=5900)c.power_on()# Wait a few seconds to let the set-top box have some time to start.time.sleep(5)# Select channel 501.c.send_key(keys.NUM_5)c.send_key(keys.NUM_0)c.send_key(keys.NUM_1)# For selecting a channel einder.Client offers a small helper function.c.select_channel(501)# No watch some TV...c.power_off()c.disconnect()
einder.Client也可以用作上下文管理器:
fromeinderimportClientwithClient("192.168.1.245")asc:c.select_channel(501)
许可证
此软件是根据MIT license授权的。