可以用 : 做成图形界面遥控器,成功接入小米盒子4,使用起来很顺畅啊。
可是,关机按键有效,能关机,开机按键无效,不能开机。好像插件有问题,大大能否把开机键弄好呀:开机按键isalive代码不完整,可能是开机键失效的原因。
PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
vol.Required(CONF_NAME): cv.string,
vol.Required(CONF_HOST): cv.string,
})
_Log=logging.getLogger(__name__)
COMMANDS = {
'isalive':'/request?action=isalive',
'power':'/controller?action=keyevent&keycode=power',
'enter':'/controller?action=keyevent&keycode=enter',
'back':'/controller?action=keyevent&keycode=back',
'home':'/controller?action=keyevent&keycode=home',
'menu':'/controller?action=keyevent&keycode=menu',
'right':'/controller?action=keyevent&keycode=right',
'left':'/controller?action=keyevent&keycode=left',
'up':'/controller?action=keyevent&keycode=up',
'down':'/controller?action=keyevent&keycode=down',
'volumedown':'/controller?action=keyevent&keycode=volumedown',
'volumeup':'/controller?action=keyevent&keycode=volumeup',
|