本帖最后由 flashbj 于 2025-8-13 10:57 编辑
目前海信爱家小程序有虚拟遥控器界面,可以通过手机来控制电视,目前控制功能还未写完,先做个遥控器的UI,让各位老爷们看看吧。
小程序的遥控器界面如下:
物理遥控器的样式如下:
因为小程序中的遥控器功能不如物理遥控器的多,比如“直播、教育、游戏”等功能在小程序上没有,抓的包中也没有以上功能的控制接口,所以我就已小程序的遥控器功能为准做了以下UI。
此UI支持“电源键、主页、菜单、设置、信号源、确认、上下左右、返回、音量+ -、静音”功能。
此UI的底图是用物理遥控器照片通过PS进行调整得来的,具体代码如下,图片请见附件。
type: vertical-stack
cards:
- type: vertical-stack
cards:
- type: picture-elements
image: /local/电视遥控器/遥控器.png
elements:
- type: icon
entity: button.dian_shi_shua_xin_an_niu
tap_action:
action: toggle
content_info: none
icon: mdi:refresh
style:
top: 7%
left: 94%
- type: image
entity: button.dian_shi_shua_xin_an_niu
image: /local/电视遥控器/开关键.png
style:
top: 11%
left: 51%
width: 10%
tap_action:
action: toggle
hold_action:
action: none
- type: image
entity: button.dian_shi_shua_xin_an_niu
image: /local/电视遥控器/主页.png
style:
top: 23%
left: 26.5%
width: 7%
tap_action:
action: toggle
- type: image
entity: button.dian_shi_shua_xin_an_niu
image: /local/电视遥控器/菜单.png
style:
top: 23%
left: 42.5%
width: 7%
tap_action:
action: toggle
- type: image
entity: button.dian_shi_shua_xin_an_niu
image: /local/电视遥控器/设置.png
style:
top: 23%
left: 58.7%
width: 11%
tap_action:
action: toggle
- type: image
entity: button.dian_shi_shua_xin_an_niu
image: /local/电视遥控器/信号源.png
style:
top: 23%
left: 74.5%
width: 8%
tap_action:
action: toggle
- type: image
entity: button.dian_shi_shua_xin_an_niu
image: /local/电视遥控器/上.png
style:
top: 35.3%
left: 51%
width: 15%
tap_action:
action: toggle
- type: image
entity: button.dian_shi_shua_xin_an_niu
image: /local/电视遥控器/下.png
style:
top: 62%
left: 51%
width: 15%
tap_action:
action: toggle
- type: image
entity: button.dian_shi_shua_xin_an_niu
image: /local/电视遥控器/左.png
style:
top: 49%
left: 30%
width: 15%
tap_action:
action: toggle
- type: image
entity: button.dian_shi_shua_xin_an_niu
image: /local/电视遥控器/右.png
style:
top: 49%
left: 71.5%
width: 15%
tap_action:
action: toggle
- type: image
entity: button.dian_shi_shua_xin_an_niu
image: /local/电视遥控器/确认.png
style:
top: 49%
left: 50.5%
width: 17%
tap_action:
action: toggle
- type: image
entity: button.dian_shi_shua_xin_an_niu
image: /local/电视遥控器/返回.png
style:
top: 77%
left: 51%
width: 12%
tap_action:
action: toggle
- type: image
entity: button.dian_shi_shua_xin_an_niu
image: /local/电视遥控器/加号.png
style:
top: 90%
left: 72%
width: 8%
tap_action:
action: toggle
- type: image
entity: button.dian_shi_shua_xin_an_niu
image: /local/电视遥控器/减号.png
style:
top: 90%
left: 30%
width: 8%
tap_action:
action: toggle
- type: image
entity: button.dian_shi_shua_xin_an_niu
image: /local/电视遥控器/静音.png
style:
top: 90%
left: 52%
width: 10%
tap_action:
action: toggle
ui中用的图片:
电视遥控器.zip
(4.75 MB, 下载次数: 1)
备注:遥控器各按键的具体功能还在努力完成中,等写完后,就可以使用此遥控器来控制电视了,敬请各位老爷们期待。
|