Make personal cards coloring more flexible for future changes

This commit is contained in:
2024-07-28 19:27:26 -04:00
parent 5a5a5a01e9
commit aba0dcdde5

View File

@ -639,12 +639,15 @@ views:
.bubble-button-background {
opacity: 1 !important;
background-color:
{% set morning_reminders = states('counter.tony_morning_meds_reminder_count') | int %}
{% set afternoon_reminders = states('counter.tony_afternoon_meds_reminder_count') | int %}
{% set night_reminders = states('counter.tony_night_meds_reminder_count') | int %}
{% if morning_reminders == 0 and afternoon_reminders == 0 and night_reminders == 0 %}
{% set counters = states.counter
| selectattr('entity_id','contains','tony')
| selectattr('entity_id','contains','meds')
| map(attribute='state')
| max
| int %}
{% if counters == 0 %}
var(--background-color-2)
{% elif morning_reminders < 3 and afternoon_reminders < 3 and night_reminders < 3 %}
{% elif counters < 3 %}
var(--warning-color)
{% else %}
var(--error-color)
@ -654,12 +657,15 @@ views:
}
.bubble-icon-container {
background:
{% set morning_reminders = states('counter.tony_morning_meds_reminder_count') | int %}
{% set afternoon_reminders = states('counter.tony_afternoon_meds_reminder_count') | int %}
{% set night_reminders = states('counter.tony_night_meds_reminder_count') | int %}
{% if morning_reminders == 0 and afternoon_reminders == 0 and night_reminders == 0 %}
{% set counters = states.counter
| selectattr('entity_id','contains','tony')
| selectattr('entity_id','contains','meds')
| map(attribute='state')
| max
| int %}
{% if counters == 0 %}
var(--card-background-color)
{% elif morning_reminders < 3 and afternoon_reminders < 3 and night_reminders < 3 %}
{% elif counters < 3 %}
var(--warning-color)
{% else %}
var(--error-color)
@ -668,10 +674,13 @@ views:
}
.bubble-icon-container::after {
opacity:
{% set morning_reminders = states('counter.tony_morning_meds_reminder_count') | int %}
{% set afternoon_reminders = states('counter.tony_afternoon_meds_reminder_count') | int %}
{% set night_reminders = states('counter.tony_night_meds_reminder_count') | int %}
{% if morning_reminders > 0 or afternoon_reminders > 0 or night_reminders > 0 %}
{% set counters = states.counter
| selectattr('entity_id','contains','tony')
| selectattr('entity_id','contains','meds')
| map(attribute='state')
| max
| int %}
{% if counters > 0 %}
0.3
{% else %}
0
@ -714,11 +723,15 @@ views:
.bubble-button-background {
opacity: 1 !important;
background-color:
{% set morning_reminders = states('counter.tina_morning_meds_reminder_count') | int %}
{% set night_reminders = states('counter.tina_night_meds_reminder_count') | int %}
{% if morning_reminders == 0 and night_reminders == 0 %}
{% set counters = states.counter
| selectattr('entity_id','contains','tina')
| selectattr('entity_id','contains','meds')
| map(attribute='state')
| max
| int %}
{% if counters == 0 %}
var(--background-color-2)
{% elif morning_reminders < 3 and night_reminders < 3 %}
{% elif counters < 3 %}
var(--warning-color)
{% else %}
var(--error-color)
@ -728,11 +741,15 @@ views:
}
.bubble-icon-container {
background:
{% set morning_reminders = states('counter.tina_morning_meds_reminder_count') | int %}
{% set night_reminders = states('counter.tina_night_meds_reminder_count') | int %}
{% if morning_reminders == 0 and night_reminders == 0 %}
{% set counters = states.counter
| selectattr('entity_id','contains','tina')
| selectattr('entity_id','contains','meds')
| map(attribute='state')
| max
| int %}
{% if counters == 0 %}
var(--card-background-color)
{% elif morning_reminders < 3 and night_reminders < 3 %}
{% elif counters < 3 %}
var(--warning-color)
{% else %}
var(--error-color)
@ -741,9 +758,13 @@ views:
}
.bubble-icon-container::after {
opacity:
{% set morning_reminders = states('counter.tina_morning_meds_reminder_count') | int %}
{% set night_reminders = states('counter.tina_night_meds_reminder_count') | int %}
{% if morning_reminders > 0 or night_reminders > 0 %}
{% set counters = states.counter
| selectattr('entity_id','contains','tina')
| selectattr('entity_id','contains','meds')
| map(attribute='state')
| max
| int %}
{% if counters > 0 %}
0.3
{% else %}
0
@ -786,11 +807,15 @@ views:
.bubble-button-background {
opacity: 1 !important;
background-color:
{% set morning_reminders = states('counter.kallen_morning_meds_reminder_count') | int %}
{% set night_reminders = states('counter.kallen_night_meds_reminder_count') | int %}
{% if morning_reminders == 0 and night_reminders == 0 %}
{% set counters = states.counter
| selectattr('entity_id','contains','kallen')
| selectattr('entity_id','contains','meds')
| map(attribute='state')
| max
| int %}
{% if counters == 0 %}
var(--background-color-2)
{% elif morning_reminders < 3 and night_reminders < 3 %}
{% elif counters < 3 %}
var(--warning-color)
{% else %}
var(--error-color)
@ -800,11 +825,15 @@ views:
}
.bubble-icon-container {
background:
{% set morning_reminders = states('counter.kallen_morning_meds_reminder_count') | int %}
{% set night_reminders = states('counter.kallen_night_meds_reminder_count') | int %}
{% if morning_reminders == 0 and night_reminders == 0 %}
{% set counters = states.counter
| selectattr('entity_id','contains','kallen')
| selectattr('entity_id','contains','meds')
| map(attribute='state')
| max
| int %}
{% if counters == 0 %}
var(--card-background-color)
{% elif morning_reminders < 3 and night_reminders < 3 %}
{% elif counters < 3 %}
var(--warning-color)
{% else %}
var(--error-color)
@ -813,9 +842,13 @@ views:
}
.bubble-icon-container::after {
opacity:
{% set morning_reminders = states('counter.kallen_morning_meds_reminder_count') | int %}
{% set night_reminders = states('counter.kallen_night_meds_reminder_count') | int %}
{% if morning_reminders > 0 or night_reminders < 0 %}
{% set counters = states.counter
| selectattr('entity_id','contains','kallen')
| selectattr('entity_id','contains','meds')
| map(attribute='state')
| max
| int %}
{% if counters > 0 %}
0.3
{% else %}
0