MQTT接口到海信电视。
hisensetv的Python项目详细描述
基于mqtt-hisensetv的海信电视正在开发的python API。在
安装
Linux
sudo -H python3.8 -m pip install hisensetv
Windows
^{pr2}$CLI使用
usage: hisensetv [-h] [--authorize] [--get {sources,volume}] [--key {back,down,exit,left,menu,power,right,up}] [--no-ssl] [-v] hostname Hisense TV control. positional arguments: hostname Hostname or IP for the TV. optional arguments: -h, --help show this help message and exit --authorize Authorize this API to access the TV. --get {sources,volume} Gets a value from the TV. --key {back,down,exit,left,menu,power,right,up} Sends a keypress to the TV. --no-ssl Do not connect with SSL (required for some models). -v, --verbose Logging verbosity.
一次性设置
hisensetv 10.0.0.128 --authorize Please enter the 4-digit code: 7815
按键
hisensetv 10.0.0.28 --key up [2020-02-29 13:48:52,064] [INFO ] sending keypress: up
获取
hisensetv 10.0.0.28 --get volume [2020-02-29 13:49:00,800] [INFO ] volume: { "volume_type": 0, "volume_value": 1 }
无SSL
某些型号没有自签名证书,因此无法连接 没有--no-ssl。在
如果您的问题没有在这里列出,请打开问题!在
- H43A6250UK
局限性
并发性
- 此类的多个实例将相互冲突。在
- 不是线程安全的。在
- 在2020年,这个API实际上应该是asyncio,但是asyncio还不是paho mqtt库的一部分(参见455)。在
可靠性
- 并发问题通常会导致可靠性问题。在
- 单元测试还不存在。在
安全
- 来自电视的自签名证书被完全绕过。在
- 项目
标签: