Advertisement
fablav

Card vacuum

Mar 25th, 2024
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 2.47 KB | Software | 0 0
  1. type: custom:mushroom-template-card
  2. entity: vacuum.vacky
  3. primary: |
  4.  {% if is_state (config.entity, 'docked') %}
  5.    Vacky
  6.   {% else %}
  7.     In pulizia {{ state_attr('vacuum.vacky', 'battery_level')}} %
  8.   {% endif %}
  9. picture: /local/ic/vacuum.png
  10. tap_action:
  11.   action: navigate
  12.   navigation_path: /bubble-d/vacky
  13. secondary: |
  14.  {% set speed = state_attr('vacuum.vacky', 'suction_grade') or '' %}
  15.   {% if speed == 3 %}
  16.   {% set vel = 'Turbo' %}
  17.   {% elif speed == 2 %}
  18.   {% set vel = 'Media' %}
  19.   {% elif speed == 1 %}
  20.   {% set vel = 'Standard' %}
  21.   {% elif speed == 0 %}
  22.   {% set vel = 'Silenziosa' %}
  23.   {% endif %}
  24.   {% if is_state (config.entity, 'docked') %}
  25.     alla base
  26.   {% else %}
  27.     Potenza {{ vel }}
  28.   {% endif %}
  29. fill_container: false
  30. card_mod:
  31.   style:
  32.     mushroom-state-info$: |
  33.      .primary {
  34.         padding-left: 0px;
  35.         font-family: 'Montserrat', cursive;
  36.         --card-primary-font-size: 14px;
  37.       }
  38.       .secondary {
  39.         padding-left: 0px;
  40.         font-family: 'Montserrat', cursive;
  41.         --card-secondary-font-size: 10px;
  42.       }
  43.     .: |
  44.      mushroom-shape-avatar {
  45.         display: flex;      
  46.         animation: {{ 'wobbling 0.5s ease-in-out infinite alternate' if not is_state('vacuum.vacky', 'docked') }};
  47.       }
  48.       @keyframes wobbling {
  49.         0% {
  50.           transform: rotate(-20deg);
  51.         }
  52.         100% {
  53.           transform: rotate(20deg);
  54.         }
  55.       }
  56.       ha-card {
  57.         background-image: url( '{{ state_attr( "vacuum.vacky", "entity_picture" ) }}' );
  58.         background-blend-mode: overlay;
  59.         background-position: bottom;
  60.         background-repeat: no-repeat;
  61.         background-size: 80%;
  62.         background-color: rgba(var(--rgb-card-background-color),0.3);
  63.         position: relative;
  64.         border: none;
  65.         box-shadow: 0px 2px 4px 0px rgba(0,0,0,0.36) !important;
  66.         --card-primary-color: black; --card-secondary-color: black;
  67.         background: {{ 'rgba(var(--rgb-amber), 0.7); --card-primary-color: black; --card-secondary-color: black; ' if not is_state('vacuum.vacky', 'docked')}};
  68.         animation: {{ 'ping 2s ease-out infinite;' if not is_state('vacuum.vacky', 'docked')}};
  69.         #transform: scale(1);
  70.         height: 66px !important;
  71.       }
  72.       @keyframes ping {
  73.         0% {
  74.           box-shadow: 0 0 5px 1px rgba(var(--rgb-amber), 1);
  75.         }
  76.         100% {
  77.           box-shadow: 0 0 5px 10px rgba(var(--rgb-amber), 0);
  78.         }
  79.       }
  80.  
Tags: ha
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement