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

[template] Store initial option as index in template select (#11523)

This commit is contained in:
J. Nick Koston
2025-10-27 17:37:40 -05:00
committed by GitHub
parent 31b1b50ad9
commit dfb4b31bf9
5 changed files with 61 additions and 25 deletions

View File

@@ -41,6 +41,17 @@ select:
- "" # Empty string at the end
initial_option: "Choice X"
- platform: template
name: "Select Initial Option Test"
id: select_initial_option_test
optimistic: true
options:
- "First"
- "Second"
- "Third"
- "Fourth"
initial_option: "Third" # Test non-default initial option
# Add a sensor to ensure we have other entities in the list
sensor:
- platform: template