Advertisement
fredrik_persson_

Irrigation Card

Jul 22nd, 2023
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.53 KB | None | 0 0
  1. - type: "custom:button-card"
  2.   entity: timer.irrigation_1
  3.   name: Irrigation
  4.   label: Greenhouse
  5.   show_name: true
  6.   show_icon: false
  7.   show_label: true
  8.   show_state: >
  9.    [[[
  10.       if (states['timer.irrigation_1'].state == 'active') {
  11.         return true;
  12.       } else {
  13.         return false;
  14.       }
  15.     ]]]
  16.   styles:
  17.     grid:
  18.       - grid-template-areas: >
  19.          [[[
  20.             if (entity.state == 'active'){
  21.               return '"n n" "l s"';}
  22.             {return '"n n" "l l"';}
  23.           ]]]
  24.  
  25.       - grid-template-rows: 1.5fr 1fr
  26.       - grid-template-columns: 1fr 1fr
  27.       - row-gap: 8px
  28.     card:
  29.       - height: 100%
  30.       - border-radius: "var(--border-radius)"
  31.       - box-shadow: "var(--box-shadow)"
  32.       - padding: 1rem
  33.       - overflow: visible
  34.       - aspect-ratio: 3/2
  35.  
  36.     name:
  37.       - text-align: left
  38.       - font-size: "var(--fs-600)"
  39.       - font-family: Montserrat
  40.       - font-weight: 600
  41.       - justify-self: start
  42.       - align-self: end
  43.       - color: "var(--contrast-100)"
  44.       - overflow: visible
  45.     label:
  46.       - text-align: left
  47.       - font-size: "var(--fs-400)"
  48.       - font-family: Montserrat
  49.       - font-weight: 500
  50.       - justify-self: start
  51.       - align-self: center
  52.       - color: "var(--contrast-100)"
  53.       - overflow: visible
  54.     state:
  55.       - text-align: right
  56.       - font-size: "var(--fs-400)"
  57.       - font-family: Montserrat
  58.       - font-weight: 500
  59.       - justify-self: end
  60.       - align-self: center
  61.       - color: "var(--contrast-100)"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement