Skip to content

Generic Swap Card

Description

example-image

This is a generic-card with swapped label and name.

Variables

Variable Default Required Notes
entity
ulm_card_generic_swap_name Set custom Name
ulm_card_generic_swap_icon Set custom Icon

Usage

- type: 'custom:button-card'
  template: card_generic_swap
  entity: sensor.next_waste_collection
Template Code
card_generic_swap.yaml
---
### Card Generic Swap ###
card_generic_swap:
  template:
    - "icon_more_info_new"
    - "ulm_actions_card"
    - "ulm_translation_engine"
  variables:
    ulm_card_generic_swap_icon: "[[[ return entity.attributes.icon ]]]"
    ulm_card_generic_swap_name: "[[[ return entity.attributes.friendly_name ]]]"
  custom_fields:
    item1:
      card:
        type: "custom:button-card"
        template:
          - "icon_more_info"
        custom_fields:
          item1:
            card:
              type: "custom:button-card"
              entity: "[[[ return entity.entity_id ]]]"
              variables:
                ulm_input_select_option: "[[[ return variables.ulm_input_select_option; ]]]"
                ulm_input_select: "[[[ return variables.ulm_input_select; ]]]"
              icon: "[[[ return variables.ulm_card_generic_swap_icon; ]]]"
              styles:
                icon:
                  - color: "rgba(var(--color-theme),0.9)"
          item2:
            card:
              type: "custom:button-card"
              entity: "[[[ return entity.entity_id ]]]"
              variables:
                ulm_input_select_option: "[[[ return variables.ulm_input_select_option; ]]]"
                ulm_input_select: "[[[ return variables.ulm_input_select; ]]]"
              label: "[[[ return variables.ulm_translation_state_unit ]]]"
              name: "[[[ return variables.ulm_card_generic_swap_name ]]]"