Repository navigation
v1.12.0
A template card hidden by its own visibility conditions no longer leaves an empty space in a sections view. This release also adds three ways to make a template depend on what a card passes it, plus a way to tweak one card without writing a new template.
Fixed
- A hidden template card no longer keeps its place in a sections view. The card collapsed itself, but a section only frees a card's grid cell when the card tells Home Assistant it is hidden, and nothing did. So the empty cell stayed, and a section with nothing but hidden template cards stayed on the page and pushed the other sections off centre. Template cards now report hiding and showing the way inline cards do, so the cell closes up and an all-hidden section goes. Badges and cards inside stacks are covered too. (#153, fixes #152)
Added
-
A block emptied by optional placeholders is now removed as well.
[[name?]]already took its own key out. The block it sat in stayed, sofeatures: [{type: '[[light_type?]]'}]with nolight_typegave the cardfeatures: [{}]. Now the empty item goes, thenfeatures, and so on upward. A block written empty in the template, or one with anything else left in it, stays as it is. (#144, from discussion #141)features: - type: '[[control?]]' # no control, no features
-
boolturns a variable into a realtrueorfalse. A card reads the word"false"as switched on, so options likehide_stateorenabledcould not be driven from a variable before.[[compact|bool]]givestrueforyes,on,1and anything else with something in it, andfalseforno,off,0, empty or unset. (#145, from discussion #142)hide_state: '[[compact|bool]]'
-
if:keeps a value only while another variable says so.[[name|if:other]]keeps it whileotheris a yes, and[[name|if:other=text]]whileotheris exactly that text. When the condition fails the value counts as unset, so?drops it and adefault:after it still applies. It lets mappings and lists through whole, so one card can choose which list items it gets. (#151, from discussion #150)color: '[[colour|if:mode=night|default:amber]]' features: - '[[toggle|if:controls?]]'
-
A card's own
card:block is laid over what its template builds. Changing one card's icon or tap action no longer needs a new template or anextends:child. Mappings merge key by key, lists replace, andnullremoves a key the template sets. Placeholders inside the block are taken literally. It applies to every copy of a repeat, and the editor's preview and Eject include it. (#146, fixes #143)type: custom:decluttering-card-plus template: room_light variables: - light: light.kitchen card: icon: mdi:light-flood-down color: teal
Upgrading
No action needed. The one change to existing output is that a block emptied by optional placeholders is now removed instead of being left as [{}] or {}. If you had moved visibility onto the card itself to avoid the gap a hidden template card left in a section, you can put it back in the template.
Docs: Variables, Using Templates, Visibility.
Full changelog: v1.11.0...v1.12.0