Advertisement
fablav

washing machine

Apr 12th, 2025
836
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 2.87 KB | Software | 0 0
  1. type: custom:stack-in-card
  2. cards:
  3.   - type: custom:mushroom-template-card
  4.     entity: binary_sensor.lavatrice_run
  5.     icon: mdi:washing-machine
  6.     badge_icon: |
  7.      {% if is_state (config.entity, 'on') %}
  8.         mdi:tshirt-crew
  9.       {% endif %}
  10.     badge_color: red
  11.     icon_color: "{{ 'orange' if is_state(entity, 'on') else 'disabled' }}"
  12.     fill_container: true
  13.     layout: horizontal
  14.     multiline_secondary: false
  15.     card_mod:
  16.       style:
  17.         mushroom-shape-icon$: |
  18.          .shape {
  19.             --icon-size: 44px;
  20.             {{ '--shape-animation: ping 2s infinite'  if is_state(config.entity, 'on') }};
  21.           }
  22.           @keyframes ping {
  23.             0% {box-shadow: 0 0 0 0 rgba(var(--rgb-orange), 0.7);}
  24.             70% {box-shadow: 0 0 0 10px transparent;}
  25.             100% {box-shadow: 0 0 0 0 transparent;}
  26.           }
  27.         .: |
  28.          ha-card {
  29.             height: 60px;
  30.             border: none !important;
  31.             background: none;
  32.             box-shadow: none;
  33.             margin-top: -3px;
  34.           }
  35.           ha-state-icon {
  36.             animation: {{ 'shake 400ms ease-in-out infinite' if is_state('binary_sensor.lavatrice_run', 'on') }};
  37.             transform-origin: 50% 58%;
  38.             clip-path: polygon(0 0, 0 100%, 35% 100%, 34% 68%, 60% 41%, 71% 56%,
  39.            65% 74%, 47% 79%, 32% 69%, 35% 100%, 100% 100%, 100% 0);
  40.           } @keyframes shake {
  41.             0%, 100% { transform: translate(0, 0) rotate(0); }
  42.             20%  { transform: translate(0.4px, -0.4px) rotate(-4deg); }
  43.             40%  { transform: translate(-0.4px, 0.4px) rotate(4deg); }
  44.             60%  { transform: translate(0.4px, 0.4px) rotate(-4deg); }
  45.             80%  { transform: translate(-0.4px, -0.4px) rotate(4deg); }
  46.           }
  47.   - type: custom:mushroom-template-card
  48.     icon: mdi:washing-machine
  49.     entity: binary_sensor.lavatrice_run
  50.     icon_color: "{{ 'blue' if is_state(entity, 'on') else 'disabled' }}"
  51.     tap_action:
  52.       action: none
  53.     double_tap_action:
  54.       action: none
  55.     hold_action:
  56.       action: none
  57.     card_mod:
  58.       style:
  59.         mushroom-shape-icon$: |
  60.          .shape {
  61.             --icon-size: 45px;
  62.             background: none !important;
  63.           }
  64.         .: |
  65.          ha-card {
  66.             background: none !important;
  67.             border: none !important;
  68.             box-shadow: none;
  69.             width: 66px;
  70.             top: -73px;
  71.           }
  72.           ha-state-icon {
  73.             {{ 'animation:spin 1s linear infinite;' if is_state('binary_sensor.lavatrice_run', 'on') }};
  74.             transform-origin: 50% 58%;
  75.             clip-path: circle(21.7% at 50% 58%);
  76.           }
  77. card_mod:
  78.   style: |
  79.    ha-card {
  80.       height: 60px !important;
  81.       background: none !important;
  82.       border: none !important;
  83.       border-radius: 14px;
  84.       transform: scale(1.2);
  85.     }
  86.  
Tags: ha
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement