Advertisement
fredrik_persson_

input_select card

May 14th, 2024
676
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 2.25 KB | None | 0 0
  1. type: custom:button-card
  2. entity: input_select.status
  3. show_icon: false
  4. show_name: false
  5. action: none
  6. styles:
  7.   grid:
  8.     - grid-template-areas: '"on off auto"'
  9.     - grid-template-columns: 1fr 1fr 1fr
  10.     - column-gap: 1rem
  11.   card:
  12.     - padding: 1rem
  13.     - box-shadow: 0rem .25rem .5rem rgba(0,0,0,0.2)
  14.     - aspect-ratio: 2
  15.     - overflow: visible
  16. state:
  17.   - value: 'on'
  18.     styles:
  19.       card:
  20.         - background: green
  21.   - value: 'off'
  22.     styles:
  23.       card:
  24.         - background: red
  25.   - value: auto
  26.     styles:
  27.       card:
  28.         - background: purple
  29. custom_fields:
  30.   'on':
  31.     card:
  32.       type: custom:button-card
  33.       entity: input_select.status
  34.       show_icon: false
  35.       name: 'On'
  36.       tap_action:
  37.         action: call-service
  38.         service: input_select.select_option
  39.         data:
  40.           option: 'on'
  41.         target:
  42.           entity_id: input_select.status
  43.       styles:
  44.         card:
  45.           - aspect-ratio: 1
  46.           - border-radius: 20rem
  47.           - background: rgba(255,255,255,.15)
  48.         name:
  49.           - color: white
  50.           - font-weight: bold
  51.           - font-size: 1.5rem
  52.   'off':
  53.     card:
  54.       type: custom:button-card
  55.       entity: input_select.status
  56.       show_icon: false
  57.       name: 'Off'
  58.       tap_action:
  59.         action: call-service
  60.         service: input_select.select_option
  61.         data:
  62.           option: 'off'
  63.         target:
  64.           entity_id: input_select.status
  65.       styles:
  66.         card:
  67.           - aspect-ratio: 1
  68.           - border-radius: 20rem
  69.           - background: rgba(255,255,255,.15)
  70.         name:
  71.           - color: white
  72.           - font-weight: bold
  73.           - font-size: 1.5rem
  74.   auto:
  75.     card:
  76.       type: custom:button-card
  77.       entity: input_select.status
  78.       show_icon: false
  79.       name: Auto
  80.       tap_action:
  81.         action: call-service
  82.         service: input_select.select_option
  83.         data:
  84.           option: auto
  85.         target:
  86.           entity_id: input_select.status
  87.       styles:
  88.         card:
  89.           - aspect-ratio: 1
  90.           - border-radius: 20rem
  91.           - background: rgba(255,255,255,.15)
  92.         name:
  93.           - color: white
  94.           - font-weight: bold
  95.           - font-size: 1.5rem
  96.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement