电视机顶盒通过涂鸦发红外传感器,把各个配对码已经弄出来在脚本里面去了。现在怎样转换成实体按键呢?有开关机,有数字按键,怎样弄成?
tvbox_ir:
sequence:
- action: remote.send_command
metadata: {}
data:
num_repeats: 1
delay_secs: 0.4
hold_secs: 0
device: TVBOX
command: ONOFF
target:
entity_id: remote.tuya_ir_remote_control
alias: TVBOX_ONOFF
- action: remote.send_command
metadata: {}
data:
num_repeats: 1
delay_secs: 0.4
hold_secs: 0
device: TVBOX
command: HOME
target:
entity_id: remote.tuya_ir_remote_control
alias: TVBOX_HOME
- action: remote.send_command
metadata: {}
data:
num_repeats: 1
delay_secs: 0.4
hold_secs: 0
device: TVBOX
command: RB
target:
entity_id: remote.tuya_ir_remote_control
alias: TVBOX_RB
- action: remote.send_command
metadata: {}
data:
num_repeats: 1
delay_secs: 0.4
hold_secs: 0
device: TVBOX
command: VOL-
target:
entity_id: remote.tuya_ir_remote_control
alias: TVBOX_VOL-
- action: remote.send_command
metadata: {}
data:
num_repeats: 1
delay_secs: 0.4
hold_secs: 0
device: TVBOX
command: VOL+
target:
entity_id: remote.tuya_ir_remote_control
alias: TVBOX_VOL+
- action: remote.send_command
metadata: {}
data:
num_repeats: 1
delay_secs: 0.4
hold_secs: 0
device: TVBOX
command: UP
target:
entity_id: remote.tuya_ir_remote_control
alias: TVBOX_UP
- action: remote.send_command
metadata: {}
data:
num_repeats: 1
delay_secs: 0.4
hold_secs: 0
device: TVBOX
command: DOWN
target:
entity_id: remote.tuya_ir_remote_control
alias: TVBOX_DOWN
- action: remote.send_command
metadata: {}
data:
num_repeats: 1
delay_secs: 0.4
hold_secs: 0
device: TVBOX
command: LEFT
target:
entity_id: remote.tuya_ir_remote_control
alias: TVBOX_LEFT
- action: remote.send_command
metadata: {}
data:
num_repeats: 1
delay_secs: 0.4
hold_secs: 0
device: TVBOX
command: RIGHT
target:
entity_id: remote.tuya_ir_remote_control
alias: TVBOX_RIGHT
- action: remote.send_command
metadata: {}
data:
num_repeats: 1
delay_secs: 0.4
hold_secs: 0
device: TVBOX
command: 1
target:
entity_id: remote.tuya_ir_remote_control
alias: TVBOX_N1
- action: remote.send_command
metadata: {}
data:
num_repeats: 1
delay_secs: 0.4
hold_secs: 0
device: TVBOX
command: 2
target:
entity_id: remote.tuya_ir_remote_control
alias: TVBOX_N2
- action: remote.send_command
metadata: {}
data:
num_repeats: 1
delay_secs: 0.4
hold_secs: 0
device: TVBOX
command: 3
target:
entity_id: remote.tuya_ir_remote_control
alias: TVBOX_N3
- action: remote.send_command
metadata: {}
data:
num_repeats: 1
delay_secs: 0.4
hold_secs: 0
device: TVBOX
command: 4
target:
entity_id: remote.tuya_ir_remote_control
alias: TVBOX_N4
- action: remote.send_command
metadata: {}
data:
num_repeats: 1
delay_secs: 0.4
hold_secs: 0
device: TVBOX
command: 5
target:
entity_id: remote.tuya_ir_remote_control
alias: TVBOX_N5
- action: remote.send_command
metadata: {}
data:
num_repeats: 1
delay_secs: 0.4
hold_secs: 0
device: TVBOX
command: 6
target:
entity_id: remote.tuya_ir_remote_control
alias: TVBOX_N6
- action: remote.send_command
metadata: {}
data:
num_repeats: 1
delay_secs: 0.4
hold_secs: 0
device: TVBOX
command: 7
target:
entity_id: remote.tuya_ir_remote_control
alias: TVBOX_N7
- action: remote.send_command
metadata: {}
data:
num_repeats: 1
delay_secs: 0.4
hold_secs: 0
device: TVBOX
command: 8
target:
entity_id: remote.tuya_ir_remote_control
alias: TVBOX_N8
- action: remote.send_command
metadata: {}
data:
num_repeats: 1
delay_secs: 0.4
hold_secs: 0
device: TVBOX
command: 9
target:
entity_id: remote.tuya_ir_remote_control
alias: TVBOX_N9
- action: remote.send_command
metadata: {}
data:
num_repeats: 1
delay_secs: 0.4
hold_secs: 0
device: TVBOX
command: 0
target:
entity_id: remote.tuya_ir_remote_control
alias: TVBOX_N0
alias: TVBOX-IR
description: ''
复制代码