Added an option to set state attributes when templating entity states.
This can be used like this (without using a template):
type: 'custom:card-templater'
card:
...
entities:
- entity: sensor.my_sensor
state_template: >
{{ "One" if states.sensor.my_sensor.state == "1" else "Not One" }}
attributes:
unit_of_measurement: "Testing"
or like this (using a template):
type: 'custom:card-templater'
card:
...
entities:
- entity: sensor.my_sensor
state_template: >
{{ "One" if states.sensor.my_sensor.state == "1" else "Not One" }}
attributes:
unit_of_measurement_template: >
{{ states.sensor.my_sensor.state }}