mirror of
https://github.com/CCOSTAN/Home-AssistantConfig.git
synced 2025-08-16 02:25:10 +00:00
New templating routines to roll out configs FAST!
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
You can use this code to quickly create files from the template editor in HA. I use it mainly for `emulated_hue`
|
||||
You can use this code to quickly create files from the template editor in HA. I use it mainly for `emulated_hue` and to quickly add in new Customize options to all things HA!
|
||||
|
||||
#########################################################3
|
||||
Create fast Customize for groups.yaml:
|
||||
@@ -8,11 +8,12 @@ Create fast Customize for groups.yaml:
|
||||
{% elif loop.last %}
|
||||
{% else %}
|
||||
{% endif %}
|
||||
{{ state.entity_id }}:
|
||||
friendly_name: '{{ state.attributes.friendly_name|replace("_"," ",)|title() if state.attributes.friendly_name is defined else state.name|replace("_"," ",)|title() }}'
|
||||
{{-'icon: '+ state.attributes.icon if state.attributes.icon is defined}}
|
||||
{{- state.entity_id }}:
|
||||
friendly_name: '{{ state.attributes.friendly_name|replace("_"," ",)|title() if state.attributes.friendly_name is defined else state.name|replace("_"," ",)|title() }}'
|
||||
emulated_hue: {{state.attributes.emulated_hue if state.attributes.emulated_hue is defined else 'False' }}
|
||||
{%- endfor -%}
|
||||
hidden: {{state.attributes.hidden if state.attributes.hidden is defined else "False"}}
|
||||
{{'icon: '+ state.attributes.icon if state.attributes.icon is defined}}
|
||||
{% endfor -%}
|
||||
|
||||
#########################################################
|
||||
Create fast Customize for lights.yaml
|
||||
@@ -26,6 +27,7 @@ Create fast Customize for lights.yaml
|
||||
friendly_name: '{{ state.attributes.friendly_name|replace("_"," ",)|title() if state.attributes.friendly_name is defined else state.name|replace("_"," ",)|title() }}'
|
||||
{{-'icon: '+ state.attributes.icon if state.attributes.icon is defined}}
|
||||
emulated_hue: {{state.attributes.emulated_hue if state.attributes.emulated_hue is defined else 'False' }}
|
||||
hidden: {{state.attributes.hidden if state.attributes.hidden is defined else "False"}}
|
||||
{%- endfor -%}
|
||||
|
||||
#########################################################
|
||||
@@ -40,4 +42,34 @@ Create fast Customize for Input_Boolean.yaml
|
||||
friendly_name: '{{ state.attributes.friendly_name|replace("_"," ",)|title() if state.attributes.friendly_name is defined else state.name|replace("_"," ",)|title() }}'
|
||||
{{-'icon: '+ state.attributes.icon if state.attributes.icon is defined}}
|
||||
emulated_hue: {{state.attributes.emulated_hue if state.attributes.emulated_hue is defined else 'False' }}
|
||||
hidden: {{state.attributes.hidden if state.attributes.hidden is defined else "False"}}
|
||||
{%- endfor -%}
|
||||
|
||||
#########################################################
|
||||
Create fast Customize for Scripts.yaml
|
||||
|
||||
{% for state in states.script-%}
|
||||
{% if loop.first %}
|
||||
{% elif loop.last %}
|
||||
{% else %}
|
||||
{% endif %}
|
||||
{{ state.entity_id }}:
|
||||
friendly_name: '{{ state.attributes.friendly_name|replace("_"," ",)|title() if state.attributes.friendly_name is defined else state.name|replace("_"," ",)|title() }}'
|
||||
{{-'icon: '+ state.attributes.icon if state.attributes.icon is defined}}
|
||||
emulated_hue: {{state.attributes.emulated_hue if state.attributes.emulated_hue is defined else 'False' }}
|
||||
hidden: {{state.attributes.hidden if state.attributes.hidden is defined else "False"}}
|
||||
{%- endfor -%}
|
||||
|
||||
#########################################################
|
||||
Create fast Customize for scenes.yaml
|
||||
|
||||
{% for state in states.scene-%}
|
||||
{% if loop.first %}
|
||||
{% elif loop.last %}
|
||||
{% else %}
|
||||
{% endif %}
|
||||
{{ state.entity_id }}:
|
||||
friendly_name: '{{ state.attributes.friendly_name|replace("_"," ",)|title() if state.attributes.friendly_name is defined else state.name|replace("_"," ",)|title() }}'
|
||||
{{-'icon: '+ state.attributes.icon if state.attributes.icon is defined}}
|
||||
emulated_hue: {{state.attributes.emulated_hue if state.attributes.emulated_hue is defined else 'False' }}
|
||||
{%- endfor -%}
|
Reference in New Issue
Block a user