1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 06:33:51 +00:00

Select enhancement (#3423)

Co-authored-by: Maurice Makaay <mmakaay1@xs4all.net>
This commit is contained in:
Maurice Makaay
2022-05-10 06:41:16 +02:00
committed by GitHub
parent 3a3d97dfa7
commit 44b68f140e
20 changed files with 461 additions and 78 deletions

View File

@@ -154,8 +154,8 @@ select:
restore_value: true
on_value:
- logger.log:
format: "Select changed to %s"
args: ["x.c_str()"]
format: "Select changed to %s (index %d)"
args: ["x.c_str()", "i"]
set_action:
- logger.log:
format: "Template Select set to %s"
@@ -163,11 +163,42 @@ select:
- select.set:
id: template_select_id
option: two
- select.first: template_select_id
- select.last:
id: template_select_id
- select.previous: template_select_id
- select.next:
id: template_select_id
cycle: false
- select.operation:
id: template_select_id
operation: Previous
cycle: false
- select.operation:
id: template_select_id
operation: !lambda "return SELECT_OP_PREVIOUS;"
cycle: !lambda "return true;"
- select.set_index:
id: template_select_id
index: 1
- select.set_index:
id: template_select_id
index: !lambda "return 1 + 1;"
options:
- one
- two
- three
- platform: modbus_controller
name: "Modbus Select Register 1000"
address: 1000
value_type: U_WORD
optionsmap:
"Zero": 0
"One": 1
"Two": 2
"Three": 3
sensor:
- platform: selec_meter
total_active_energy: