用于与Sony Bravia TV的远程接口的库。
py-sony-bravia-remote的Python项目详细描述
py-sony-bravia-remote是一个python 3库,用于与sony bravia tv的远程接口。 电视曝光的api。这允许你控制诸如改变音量、频道或打开和关闭电视之类的事情。
这个api与“sony remote”应用程序用来控制电视的api完全相同。
安装
要包含在另一个项目中,请通过pip安装:
pip install py-sony-bravia-remote
示例用法
fromsonybraviaremoteimportTV,TVConfig# called the very first time you attempt to connect to your# tv... the tv will display a pincode that you need to enter# after the first connection attempt, you'll never have to do this againdefon_auth():returninput('Pincode: ')# ip address of your tv... the device name is the name under which# your program will be registered... note that if you change the device# name, you have to re-authconfig=TVConfig('192.168.0.23','my device name')tv=TV(config,on_auth)tv.is_on()# true/falsetv.wake_up()tv.power_off()tv.netflix()tv.home()tv.enter()tv.confirm()tv.pause()tv.play()tv.confirm()tv.mute()tv.volume_up()tv.volume_down()