first thank you very much,second please believe me if i tell u that i read i tried it,but i so bad for all this,thanks again and sorry
now i can sleep quiet,thank you very much
Now that I see it done with my own examples I feel very ridiculous
Sorry, thereâs a bug when the value is 0 (or when a field with template support has 0 as its value)⊠A fix is ready for the next release. Just waiting a bit to see if something else pops up https://github.com/custom-cards/button-card/pull/203
I have a question
I donât know if it belongs here or in the decluttering cardâŠ
How can I template several lines?
For example, I have this:
- type: custom:decluttering-card
template: standard_square_button
variables:
- entity: input_number.hall_max_temp
- name: Hall <br> Max Temp
- show_label: true
- label: var date = states['input_datetime.hall_max_temp_date'].state; return date
and my decluttering card includes this:
label: >
[[[
[[label]]
]]]
Which works but Iâd prefer to have the label: declared over several lines for readability. In this particular case I want to add reformatting to the date so making the line of code even longer but I also have some quite long templates.
Iâve tried a few things e.g.
- label: >
var date = states['input_datetime.hall_max_temp_date'].state;
return date
If a field with template support had the number 0 as a value, the fieldâs value would be transformed into undefined
When in an *_action the service_data field contained parameters which where objects or booleans, an error was thrown and the action wouldnât execute.
Thanks @RomRider, but the e.trim is not a function error is still there and the tap_action does nothing.
The state with value 0 works, so could be no cache issue i think.
Do you want the whole template? It is hugeâŠ
The relevant bit is I originally posted but adjusted to look like your exampleâŠ
standard_square_button:
default:
...Loads of default values defined here...
- show_label: false
...Loads more defaults defined here...
- label: ' '
...yet more defaults defined here...
card:
type: custom:button-card
entity: '[[entity]]'
name: '[[name]]'
lock: '[[lock]]'
size: '[[size]]'
aspect_ratio: '[[aspect_ratio]]'
label: '[[label]]'
...more card values and lots of styles and states