Dynamic Options and Templatable Value
Dynamic Dropdown and Selector Options #205
You can now generate dropdown and selector options dynamically via entity attributes or a templated list. Each option element will be auto-generated using the options list and template.
While this option template will be autofilled, you can modify it as you like to change it's appearance and action. You can use the template variable {{ option }} to use the current option string in both dynamic and default static options.
Most entities and attributes will be matched to their corresponding select actions.
| Domain | Value Attribute | List Attribute | Action | Data Key |
|---|---|---|---|---|
| select | state | options | select_option | option |
| input_select | state | options | select_option | option |
| light | effect | effect_list | turn_on | effect |
| media_player | source | source_list | select_source | source |
| media_player | sound_mode | sound_mode_list | select_sound_mode | sound_mode |
| remote | activity | activity_list | turn_on | current_activity |
| climate | state | hvac_modes | set_hvac_mode | hvac_mode |
| climate | fan_mode | fan_modes | set_fan_mode | fan_mode |
| climate | swing_mode | swing_modes | set_swing_mode | swing_mode |
| climate | preset_mode | preset_modes | set_prest_mode | preset_mode |
| fan | preset_mode | preset_modes | set_preset_mode | preset_mode |
| humidifier | mode | available_modes | set_mode | mode |
| water_heater | state | operation_modes | set_operation_mode | operation_mode |
| vacuum | fan_speed | fan_speed_list | set_fan_speed | fan_speed |
Huge thanks to @kristofferR, who implemented dynamic options!
Value Templates #208
Instead of setting feature value using entity states or attributes, you can now define the feature value using a template. Remove the entity from the feature and a new code box should appear where you can enter a template or static value to set the feature value. Note that the feature entity must be completely unset for this value template to be used.
Other Changes
- iOS slider tap fix #150.
- Refactor internal element querying.
- Use
ha-selectortemplate and object for editor code boxes. - Disable slider transition until 250ms until after first updated.
Full Changelog: 4.9.4...4.10.0