From 96daf69f78d92ad63046d8472a6b2884fb7c5f9b Mon Sep 17 00:00:00 2001 From: Georgi Gardev Date: Sun, 22 Mar 2020 09:59:52 +0200 Subject: [PATCH] More COVID-19 --- config/configuration.yaml | 2 + config/lovelace/07_covid_19.yaml | 108 +++++++----------------- config/lovelace/templates/covid_19.yaml | 42 +++++++++ 3 files changed, 74 insertions(+), 78 deletions(-) create mode 100644 config/lovelace/templates/covid_19.yaml diff --git a/config/configuration.yaml b/config/configuration.yaml index bbc391e..2c9551f 100644 --- a/config/configuration.yaml +++ b/config/configuration.yaml @@ -59,6 +59,8 @@ lovelace: url: /hacsfiles/lovelace-multiple-entity-row/multiple-entity-row.js - type: module url: /hacsfiles/decluttering-card/decluttering-card.js + - type: module + url: /hacsfiles/lovelace-layout-card/layout-card.js dashboards: lovelace-yaml: mode: yaml diff --git a/config/lovelace/07_covid_19.yaml b/config/lovelace/07_covid_19.yaml index 079ecde..74ac577 100644 --- a/config/lovelace/07_covid_19.yaml +++ b/config/lovelace/07_covid_19.yaml @@ -1,87 +1,39 @@ title: COVID-19 path: covid-19 -panel: false +panel: true icon: "mdi:biohazard" badges: [] cards: - - type: vertical-stack + - type: custom:layout-card + min_columns: 3 + max_columns: 3 cards: - - type: glance - title: COVID-19 Worldwide - show_name: true - columns: 4 - entities: - - entity: sensor.worldwide_coronavirus_confirmed - name: Confirmed - icon: "mdi:emoticon-confused-outline" - - entity: sensor.worldwide_coronavirus_current - name: Current - icon: "mdi:emoticon-sad-outline" - - entity: sensor.worldwide_coronavirus_deaths - name: Deaths - icon: "mdi:emoticon-cry-outline" - - entity: sensor.worldwide_coronavirus_recovered - name: Recovered - icon: "mdi:emoticon-cool-outline" + - type: custom:decluttering-card + template: covid_19 + variables: + - name: Worldwide + - location: worldwide - - type: "custom:mini-graph-card" - animate: true - icon: mdi:emoticon-confused - line_width: 3 - line_color: - - var(--paper-orange-400) - - var(--paper-green-400) - - var(--accent-color) - hours_to_show: 168 - points_per_hour: 0.04 - entities: - - entity: sensor.worldwide_coronavirus_deaths - index: 0 - name: Deaths - - entity: sensor.worldwide_coronavirus_recovered - index: 1 - name: Recovered - - entity: sensor.worldwide_coronavirus_current - index: 2 - name: Current + - type: custom:decluttering-card + template: covid_19 + variables: + - name: Bulgaria + - location: bulgaria - - type: vertical-stack - cards: - - type: glance - title: COVID-19 Bulgaria - show_name: true - columns: 4 - entities: - - entity: sensor.bulgaria_coronavirus_confirmed - name: Confirmed - icon: "mdi:emoticon-confused-outline" - - entity: sensor.bulgaria_coronavirus_current - name: Current - icon: "mdi:emoticon-sad-outline" - - entity: sensor.bulgaria_coronavirus_deaths - name: Deaths - icon: "mdi:emoticon-cry-outline" - - entity: sensor.bulgaria_coronavirus_recovered - name: Recovered - icon: "mdi:emoticon-cool-outline" + - type: custom:decluttering-card + template: covid_19 + variables: + - name: Italy + - location: italy - - type: "custom:mini-graph-card" - animate: true - icon: mdi:emoticon-confused - line_width: 3 - line_color: - - var(--accent-color) - - var(--paper-orange-400) - - var(--paper-green-400) - hours_to_show: 168 - points_per_hour: 0.04 - entities: - - entity: sensor.bulgaria_coronavirus_current - index: 0 - name: Current - - entity: sensor.bulgaria_coronavirus_deaths - index: 1 - name: Deaths - - entity: sensor.bulgaria_coronavirus_recovered - index: 2 - name: Recovered + - type: custom:decluttering-card + template: covid_19 + variables: + - name: France + - location: france + + - type: custom:decluttering-card + template: covid_19 + variables: + - name: USA + - location: us diff --git a/config/lovelace/templates/covid_19.yaml b/config/lovelace/templates/covid_19.yaml new file mode 100644 index 0000000..03102a4 --- /dev/null +++ b/config/lovelace/templates/covid_19.yaml @@ -0,0 +1,42 @@ +covid_19: + card: + type: vertical-stack + cards: + - type: glance + title: COVID-19 [[name]] + show_name: true + columns: 4 + entities: + - entity: sensor.[[location]]_coronavirus_confirmed + name: Confirmed + icon: "mdi:emoticon-confused-outline" + - entity: sensor.[[location]]_coronavirus_current + name: Current + icon: "mdi:emoticon-sad-outline" + - entity: sensor.[[location]]_coronavirus_deaths + name: Deaths + icon: "mdi:emoticon-cry-outline" + - entity: sensor.[[location]]_coronavirus_recovered + name: Recovered + icon: "mdi:emoticon-cool-outline" + + - type: "custom:mini-graph-card" + animate: true + icon: mdi:emoticon-confused + line_width: 3 + line_color: + - var(--paper-orange-400) + - var(--paper-green-400) + - var(--accent-color) + hours_to_show: 168 + points_per_hour: 0.04 + entities: + - entity: sensor.[[location]]_coronavirus_deaths + index: 0 + name: Deaths + - entity: sensor.[[location]]_coronavirus_recovered + index: 1 + name: Recovered + - entity: sensor.[[location]]_coronavirus_current + index: 2 + name: "Current"