From 3535549f51d96f22cff639c372165ed673983ec0 Mon Sep 17 00:00:00 2001 From: MatthewSean <70664811+MatthewSean@users.noreply.github.com> Date: Wed, 17 Aug 2022 14:01:02 +0100 Subject: [PATCH 01/21] Create popup_thermostat_preset.yaml --- .../popups/popup_thermostat_preset.yaml | 346 ++++++++++++++++++ 1 file changed, 346 insertions(+) create mode 100644 custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat_preset.yaml diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat_preset.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat_preset.yaml new file mode 100644 index 000000000..4f0921074 --- /dev/null +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat_preset.yaml @@ -0,0 +1,346 @@ +--- +popup_thermostat_preset: + show_icon: false + show_name: false + show_label: false + show_units: false + styles: + grid: + - grid-template-areas: "'header' 'content1' 'buttons' 'footer'" + - grid-template-rows: "16vh 42vh 14vh 14vh" + - grid-template-columns: "1fr" + - column-gap: "30px" + card: + - background: "var(--primary-background-color)" + - box-shadow: "none" + - padding: "4%" + custom_fields: + header: + - align-self: "start" + content1: + - align-self: "center" + buttons: + - align-self: "start" + - width: "50%" + - margin: "0 auto" + footer: + - align-self: "end" + - margin-top: "25px" + extra_styles: | + @media (max-width: 800px) { + #container { + grid-template-rows: 16vh 52vh 14vh 14vh !important; + } + #buttons { + width: 100% !important; + } + custom_fields: + header: + card: + type: "custom:button-card" + template: "popup_header" + entity: "[[[ return entity.entity_id ]]]" + content1: + card: + type: "thermostat" + entity: "[[[ return entity.entity_id ]]]" + card_mod: + style: | + ha-card { + background: none !important; + box-shadow: none !important; + padding: 0 0 20px 0 !important; + } + .more-info { + display: none; + } + #info { + display: none; + } + .type-thermostat { + --mode-color: rgb(var(--color-blue)) !important; + } + buttons: + card: + type: "custom:button-card" + styles: + grid: + - grid-template-areas: > + [[[ + var areas = []; + if (entity.attributes.preset_modes.includes("none")) { + areas.push("none"); + } + if (entity.attributes.preset_modes.includes("away")) { + areas.push("away"); + } + if (entity.attributes.preset_modes.includes("comfort")) { + areas.push("comfort"); + } + if (entity.attributes.preset_modes.includes("home")) { + areas.push("home"); + } + if (entity.attributes.preset_modes.includes("sleep")) { + areas.push("sleep"); + } + if (entity.attributes.preset_modes.includes("activity")) { + areas.push("activity"); + } + return "\"" + areas.join(" ") + "\""; + ]]] + - grid-template-columns: > + [[[ + var columns = []; + if (entity.attributes.preset_modes.includes("none")) { + columns.push("1fr"); + } + if (entity.attributes.preset_modes.includes("away")) { + columns.push("1fr"); + } + if (entity.attributes.preset_modes.includes("comfort")) { + columns.push("1fr"); + } + if (entity.attributes.preset_modes.includes("home")) { + columns.push("1fr"); + } + if (entity.attributes.preset_modes.includes("sleep")) { + columns.push("1fr"); + } + if (entity.attributes.preset_modes.includes("activity")) { + columns.push("1fr"); + } + return columns.join(" "); + ]]] + - grid-template-rows: "min-content" + - justify-items: "center" + card: + - box-shadow: "none" + - padding: "0px" + - border-radius: "21px" + - background-color: "rgba(var(--color-theme),0.1)" + custom_fields: + none: + - display: > + [[[ + if (entity.attributes.preset_modes.includes("none")) { + return "block"; + } else { + return "none"; + } + ]]] + away: + - display: > + [[[ + if (entity.attributes.preset_modes.includes("away")) { + return "block"; + } else { + return "none"; + } + ]]] + comfort: + - display: > + [[[ + if (entity.attributes.preset_modes.includes("comfort")) { + return "block"; + } else { + return "none"; + } + ]]] + home: + - display: > + [[[ + if (entity.attributes.preset_modes.includes("home")) { + return "block"; + } else { + return "none"; + } + ]]] + sleep: + - display: > + [[[ + if (entity.attributes.preset_modes.includes("sleep")) { + return "block"; + } else { + return "none"; + } + ]]] + activity: + - display: > + [[[ + if (entity.attributes.preset_modes.includes("activity")) { + return "block"; + } else { + return "none"; + } + ]]] + custom_fields: + none: + card: + type: "custom:button-card" + entity: "[[[ return entity.entity_id ]]]" + template: "widget_icon" + icon: "mdi:toggle-switch-off-outline" + tap_action: + action: "call-service" + service: "climate.set_preset_mode" + service_data: + entity_id: "[[[ return entity.entity_id ]]]" + preset_mode: "none" + styles: + card: + - background-color: "transparent" + - height: "42px" + - width: "42px" + - border-radius: "50%" + - box-shadow: "none" + state: + - value: "none" + styles: + card: + - background-color: "var(--card-background-color)" + - box-shadow: "var( --ha-card-box-shadow)" + - transform: "scale(0.95)" + away: + card: + type: "custom:button-card" + entity: "[[[ return entity.entity_id ]]]" + template: "widget_icon" + icon: "mdi:car" + tap_action: + action: "call-service" + service: "climate.set_preset_mode" + service_data: + entity_id: "[[[ return entity.entity_id ]]]" + preset_mode: "away" + styles: + card: + - background-color: "transparent" + - height: "42px" + - width: "42px" + - border-radius: "50%" + - box-shadow: "none" + state: + - value: "away" + styles: + card: + - background-color: "var(--card-background-color)" + - box-shadow: "var( --ha-card-box-shadow)" + - transform: "scale(0.95)" + comfort: + card: + type: "custom:button-card" + entity: "[[[ return entity.entity_id ]]]" + template: "widget_icon" + icon: "mdi:car-seat-heater" + tap_action: + action: "call-service" + service: "climate.set_preset_mode" + service_data: + entity_id: "[[[ return entity.entity_id ]]]" + preset_mode: "comfort" + styles: + card: + - background-color: "transparent" + - height: "42px" + - width: "42px" + - border-radius: "50%" + - box-shadow: "none" + state: + - value: "comfort" + styles: + card: + - background-color: "var(--card-background-color)" + - box-shadow: "var( --ha-card-box-shadow)" + - transform: "scale(0.95)" + home: + card: + type: "custom:button-card" + entity: "[[[ return entity.entity_id ]]]" + template: "widget_icon" + icon: "mdi:home" + tap_action: + action: "call-service" + service: "climate.set_preset_mode" + service_data: + entity_id: "[[[ return entity.entity_id ]]]" + preset_mode: "home" + styles: + card: + - background-color: "transparent" + - height: "42px" + - width: "42px" + - border-radius: "50%" + - box-shadow: "none" + state: + - value: "home" + styles: + card: + - background-color: "var(--card-background-color)" + - box-shadow: "var( --ha-card-box-shadow)" + - transform: "scale(0.95)" + sleep: + card: + type: "custom:button-card" + entity: "[[[ return entity.entity_id ]]]" + template: "widget_icon" + icon: "mdi:sleep" + tap_action: + action: "call-service" + service: "climate.set_preset_mode" + service_data: + entity_id: "[[[ return entity.entity_id ]]]" + preset_mode: "sleep" + styles: + card: + - background-color: "transparent" + - height: "42px" + - width: "42px" + - border-radius: "50%" + - box-shadow: "none" + state: + - value: "sleep" + styles: + card: + - background-color: "var(--card-background-color)" + - box-shadow: "var( --ha-card-box-shadow)" + - transform: "scale(0.95)" + activity: + card: + type: "custom:button-card" + entity: "[[[ return entity.entity_id ]]]" + template: "widget_icon" + icon: "mdi:ticket" + tap_action: + action: "call-service" + service: "climate.set_preset_mode" + service_data: + entity_id: "[[[ return entity.entity_id ]]]" + preset_mode: "activity" + styles: + card: + - background-color: "transparent" + - height: "42px" + - width: "42px" + - border-radius: "50%" + - box-shadow: "none" + state: + - value: "activity" + styles: + card: + - background-color: "var(--card-background-color)" + - box-shadow: "var( --ha-card-box-shadow)" + - transform: "scale(0.95)" + footer: + card: + type: "custom:button-card" + template: "popup_list_items" + custom_fields: + item1: + card: + type: "custom:button-card" + template: "popup_button_back" + item2: + card: + type: "custom:button-card" + template: "popup_button_power" + entity: "[[[ return entity.entity_id ]]]" From 4d1e920008a79ad5a8ce8394beeada0aa7aaff58 Mon Sep 17 00:00:00 2001 From: MatthewSean <70664811+MatthewSean@users.noreply.github.com> Date: Wed, 17 Aug 2022 14:39:53 +0100 Subject: [PATCH 02/21] Update popup_thermostat_preset.yaml --- .../popups/popup_thermostat_preset.yaml | 24 ++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat_preset.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat_preset.yaml index 4f0921074..4e77f56b9 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat_preset.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat_preset.yaml @@ -194,7 +194,9 @@ popup_thermostat_preset: - border-radius: "50%" - box-shadow: "none" state: - - value: "none" +# - value: "none" + - operator: template + value: "[[[ return entity.attributes.preset_mode == 'none' ]]]" styles: card: - background-color: "var(--card-background-color)" @@ -220,7 +222,9 @@ popup_thermostat_preset: - border-radius: "50%" - box-shadow: "none" state: - - value: "away" +# - value: "away" + - operator: template + value: "[[[ return entity.attributes.preset_mode == 'away' ]]]" styles: card: - background-color: "var(--card-background-color)" @@ -246,7 +250,9 @@ popup_thermostat_preset: - border-radius: "50%" - box-shadow: "none" state: - - value: "comfort" +# - value: "comfort" + - operator: template + value: "[[[ return entity.attributes.preset_mode == 'comfort' ]]]" styles: card: - background-color: "var(--card-background-color)" @@ -272,7 +278,9 @@ popup_thermostat_preset: - border-radius: "50%" - box-shadow: "none" state: - - value: "home" +# - value: "home" + - operator: template + value: "[[[ return entity.attributes.preset_mode == 'home' ]]]" styles: card: - background-color: "var(--card-background-color)" @@ -298,7 +306,9 @@ popup_thermostat_preset: - border-radius: "50%" - box-shadow: "none" state: - - value: "sleep" +# - value: "sleep" + - operator: template + value: "[[[ return entity.attributes.preset_mode == 'sleep' ]]]" styles: card: - background-color: "var(--card-background-color)" @@ -324,7 +334,9 @@ popup_thermostat_preset: - border-radius: "50%" - box-shadow: "none" state: - - value: "activity" +# - value: "activity" + - operator: template + value: "[[[ return entity.attributes.preset_mode == 'activity' ]]]" styles: card: - background-color: "var(--card-background-color)" From 05682fe72a2d69f30b36d976015233c6ad1ed733 Mon Sep 17 00:00:00 2001 From: MatthewSean <70664811+MatthewSean@users.noreply.github.com> Date: Wed, 17 Aug 2022 23:48:19 +0100 Subject: [PATCH 03/21] Update popup_thermostat_preset.yaml --- .../popups/popup_thermostat_preset.yaml | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat_preset.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat_preset.yaml index 4e77f56b9..f0b9991fc 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat_preset.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat_preset.yaml @@ -194,9 +194,8 @@ popup_thermostat_preset: - border-radius: "50%" - box-shadow: "none" state: -# - value: "none" - operator: template - value: "[[[ return entity.attributes.preset_mode == 'none' ]]]" + value: "[[[ return entity.attributes.preset_mode == "none" ]]]" styles: card: - background-color: "var(--card-background-color)" @@ -222,9 +221,8 @@ popup_thermostat_preset: - border-radius: "50%" - box-shadow: "none" state: -# - value: "away" - operator: template - value: "[[[ return entity.attributes.preset_mode == 'away' ]]]" + value: "[[[ return entity.attributes.preset_mode == "away" ]]]" styles: card: - background-color: "var(--card-background-color)" @@ -250,9 +248,8 @@ popup_thermostat_preset: - border-radius: "50%" - box-shadow: "none" state: -# - value: "comfort" - operator: template - value: "[[[ return entity.attributes.preset_mode == 'comfort' ]]]" + value: "[[[ return entity.attributes.preset_mode == "comfort" ]]]" styles: card: - background-color: "var(--card-background-color)" @@ -278,9 +275,8 @@ popup_thermostat_preset: - border-radius: "50%" - box-shadow: "none" state: -# - value: "home" - operator: template - value: "[[[ return entity.attributes.preset_mode == 'home' ]]]" + value: "[[[ return entity.attributes.preset_mode == "home" ]]]" styles: card: - background-color: "var(--card-background-color)" @@ -306,9 +302,8 @@ popup_thermostat_preset: - border-radius: "50%" - box-shadow: "none" state: -# - value: "sleep" - operator: template - value: "[[[ return entity.attributes.preset_mode == 'sleep' ]]]" + value: "[[[ return entity.attributes.preset_mode == "sleep" ]]]" styles: card: - background-color: "var(--card-background-color)" @@ -334,9 +329,8 @@ popup_thermostat_preset: - border-radius: "50%" - box-shadow: "none" state: -# - value: "activity" - operator: template - value: "[[[ return entity.attributes.preset_mode == 'activity' ]]]" + value: "[[[ return entity.attributes.preset_mode == "activity" ]]]" styles: card: - background-color: "var(--card-background-color)" From 7c97a431ed43dafc93999a79e1f11a25dcbfa71d Mon Sep 17 00:00:00 2001 From: MatthewSean <70664811+MatthewSean@users.noreply.github.com> Date: Thu, 18 Aug 2022 23:30:14 +0100 Subject: [PATCH 04/21] Update popup_thermostat_preset.yaml --- .../popups/popup_thermostat_preset.yaml | 36 +++++++++---------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat_preset.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat_preset.yaml index f0b9991fc..616d9571d 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat_preset.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat_preset.yaml @@ -7,7 +7,7 @@ popup_thermostat_preset: styles: grid: - grid-template-areas: "'header' 'content1' 'buttons' 'footer'" - - grid-template-rows: "16vh 42vh 14vh 14vh" + - grid-template-rows: "16vh 32vh 14vh 14vh" - grid-template-columns: "1fr" - column-gap: "30px" card: @@ -27,9 +27,9 @@ popup_thermostat_preset: - align-self: "end" - margin-top: "25px" extra_styles: | - @media (max-width: 800px) { + @media (max-width: 500px) { #container { - grid-template-rows: 16vh 52vh 14vh 14vh !important; + grid-template-rows: 16vh 42vh 14vh 14vh !important; } #buttons { width: 100% !important; @@ -179,7 +179,7 @@ popup_thermostat_preset: type: "custom:button-card" entity: "[[[ return entity.entity_id ]]]" template: "widget_icon" - icon: "mdi:toggle-switch-off-outline" + icon: "mdi:toggle-switch-off" tap_action: action: "call-service" service: "climate.set_preset_mode" @@ -194,8 +194,8 @@ popup_thermostat_preset: - border-radius: "50%" - box-shadow: "none" state: - - operator: template - value: "[[[ return entity.attributes.preset_mode == "none" ]]]" + - operator: "template" + value: '[[[ return entity.attributes.preset_mode == "none" ]]]' styles: card: - background-color: "var(--card-background-color)" @@ -206,7 +206,7 @@ popup_thermostat_preset: type: "custom:button-card" entity: "[[[ return entity.entity_id ]]]" template: "widget_icon" - icon: "mdi:car" + icon: "mdi:home-switch-outline" tap_action: action: "call-service" service: "climate.set_preset_mode" @@ -221,8 +221,8 @@ popup_thermostat_preset: - border-radius: "50%" - box-shadow: "none" state: - - operator: template - value: "[[[ return entity.attributes.preset_mode == "away" ]]]" + - operator: "template" + value: '[[[ return entity.attributes.preset_mode == "away" ]]]' styles: card: - background-color: "var(--card-background-color)" @@ -233,7 +233,7 @@ popup_thermostat_preset: type: "custom:button-card" entity: "[[[ return entity.entity_id ]]]" template: "widget_icon" - icon: "mdi:car-seat-heater" + icon: "mdi:car-seat-cooler" tap_action: action: "call-service" service: "climate.set_preset_mode" @@ -248,8 +248,8 @@ popup_thermostat_preset: - border-radius: "50%" - box-shadow: "none" state: - - operator: template - value: "[[[ return entity.attributes.preset_mode == "comfort" ]]]" + - operator: "template" + value: '[[[ return entity.attributes.preset_mode == "comfort" ]]]' styles: card: - background-color: "var(--card-background-color)" @@ -275,8 +275,8 @@ popup_thermostat_preset: - border-radius: "50%" - box-shadow: "none" state: - - operator: template - value: "[[[ return entity.attributes.preset_mode == "home" ]]]" + - operator: "template" + value: '[[[ return entity.attributes.preset_mode == "home" ]]]' styles: card: - background-color: "var(--card-background-color)" @@ -302,8 +302,8 @@ popup_thermostat_preset: - border-radius: "50%" - box-shadow: "none" state: - - operator: template - value: "[[[ return entity.attributes.preset_mode == "sleep" ]]]" + - operator: "template" + value: '[[[ return entity.attributes.preset_mode == "sleep" ]]]' styles: card: - background-color: "var(--card-background-color)" @@ -329,8 +329,8 @@ popup_thermostat_preset: - border-radius: "50%" - box-shadow: "none" state: - - operator: template - value: "[[[ return entity.attributes.preset_mode == "activity" ]]]" + - operator: "template" + value: '[[[ return entity.attributes.preset_mode == "activity" ]]]' styles: card: - background-color: "var(--card-background-color)" From fe6fb511fbba4f98a1f4bae70c56ceec5492af29 Mon Sep 17 00:00:00 2001 From: basbruss <68892092+basbruss@users.noreply.github.com> Date: Wed, 31 Aug 2022 16:01:08 +0200 Subject: [PATCH 05/21] Combine thermostat popups Activate preset_mode with: ```yaml variables: ulm_popup_thermostat_preset_mode: true ``` --- .../popups/popup_thermostat.yaml | 2 + .../popups/popup_thermostat_preset.yaml | 352 ------------------ .../popups/popup_thermostat_temperature.yaml | 326 ++++++++++++++-- 3 files changed, 294 insertions(+), 386 deletions(-) delete mode 100644 custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat_preset.yaml diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat.yaml index 9735668a2..381fdc639 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat.yaml @@ -10,3 +10,5 @@ popup_thermostat: type: "custom:button-card" template: "popup_thermostat_temperature" entity: "[[[ return entity.entity_id ]]]" + variables: + ulm_popup_thermostat_preset_mode: "[[[ return variables.ulm_popup_thermostat_preset_mode; ]]]" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat_preset.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat_preset.yaml deleted file mode 100644 index 616d9571d..000000000 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat_preset.yaml +++ /dev/null @@ -1,352 +0,0 @@ ---- -popup_thermostat_preset: - show_icon: false - show_name: false - show_label: false - show_units: false - styles: - grid: - - grid-template-areas: "'header' 'content1' 'buttons' 'footer'" - - grid-template-rows: "16vh 32vh 14vh 14vh" - - grid-template-columns: "1fr" - - column-gap: "30px" - card: - - background: "var(--primary-background-color)" - - box-shadow: "none" - - padding: "4%" - custom_fields: - header: - - align-self: "start" - content1: - - align-self: "center" - buttons: - - align-self: "start" - - width: "50%" - - margin: "0 auto" - footer: - - align-self: "end" - - margin-top: "25px" - extra_styles: | - @media (max-width: 500px) { - #container { - grid-template-rows: 16vh 42vh 14vh 14vh !important; - } - #buttons { - width: 100% !important; - } - custom_fields: - header: - card: - type: "custom:button-card" - template: "popup_header" - entity: "[[[ return entity.entity_id ]]]" - content1: - card: - type: "thermostat" - entity: "[[[ return entity.entity_id ]]]" - card_mod: - style: | - ha-card { - background: none !important; - box-shadow: none !important; - padding: 0 0 20px 0 !important; - } - .more-info { - display: none; - } - #info { - display: none; - } - .type-thermostat { - --mode-color: rgb(var(--color-blue)) !important; - } - buttons: - card: - type: "custom:button-card" - styles: - grid: - - grid-template-areas: > - [[[ - var areas = []; - if (entity.attributes.preset_modes.includes("none")) { - areas.push("none"); - } - if (entity.attributes.preset_modes.includes("away")) { - areas.push("away"); - } - if (entity.attributes.preset_modes.includes("comfort")) { - areas.push("comfort"); - } - if (entity.attributes.preset_modes.includes("home")) { - areas.push("home"); - } - if (entity.attributes.preset_modes.includes("sleep")) { - areas.push("sleep"); - } - if (entity.attributes.preset_modes.includes("activity")) { - areas.push("activity"); - } - return "\"" + areas.join(" ") + "\""; - ]]] - - grid-template-columns: > - [[[ - var columns = []; - if (entity.attributes.preset_modes.includes("none")) { - columns.push("1fr"); - } - if (entity.attributes.preset_modes.includes("away")) { - columns.push("1fr"); - } - if (entity.attributes.preset_modes.includes("comfort")) { - columns.push("1fr"); - } - if (entity.attributes.preset_modes.includes("home")) { - columns.push("1fr"); - } - if (entity.attributes.preset_modes.includes("sleep")) { - columns.push("1fr"); - } - if (entity.attributes.preset_modes.includes("activity")) { - columns.push("1fr"); - } - return columns.join(" "); - ]]] - - grid-template-rows: "min-content" - - justify-items: "center" - card: - - box-shadow: "none" - - padding: "0px" - - border-radius: "21px" - - background-color: "rgba(var(--color-theme),0.1)" - custom_fields: - none: - - display: > - [[[ - if (entity.attributes.preset_modes.includes("none")) { - return "block"; - } else { - return "none"; - } - ]]] - away: - - display: > - [[[ - if (entity.attributes.preset_modes.includes("away")) { - return "block"; - } else { - return "none"; - } - ]]] - comfort: - - display: > - [[[ - if (entity.attributes.preset_modes.includes("comfort")) { - return "block"; - } else { - return "none"; - } - ]]] - home: - - display: > - [[[ - if (entity.attributes.preset_modes.includes("home")) { - return "block"; - } else { - return "none"; - } - ]]] - sleep: - - display: > - [[[ - if (entity.attributes.preset_modes.includes("sleep")) { - return "block"; - } else { - return "none"; - } - ]]] - activity: - - display: > - [[[ - if (entity.attributes.preset_modes.includes("activity")) { - return "block"; - } else { - return "none"; - } - ]]] - custom_fields: - none: - card: - type: "custom:button-card" - entity: "[[[ return entity.entity_id ]]]" - template: "widget_icon" - icon: "mdi:toggle-switch-off" - tap_action: - action: "call-service" - service: "climate.set_preset_mode" - service_data: - entity_id: "[[[ return entity.entity_id ]]]" - preset_mode: "none" - styles: - card: - - background-color: "transparent" - - height: "42px" - - width: "42px" - - border-radius: "50%" - - box-shadow: "none" - state: - - operator: "template" - value: '[[[ return entity.attributes.preset_mode == "none" ]]]' - styles: - card: - - background-color: "var(--card-background-color)" - - box-shadow: "var( --ha-card-box-shadow)" - - transform: "scale(0.95)" - away: - card: - type: "custom:button-card" - entity: "[[[ return entity.entity_id ]]]" - template: "widget_icon" - icon: "mdi:home-switch-outline" - tap_action: - action: "call-service" - service: "climate.set_preset_mode" - service_data: - entity_id: "[[[ return entity.entity_id ]]]" - preset_mode: "away" - styles: - card: - - background-color: "transparent" - - height: "42px" - - width: "42px" - - border-radius: "50%" - - box-shadow: "none" - state: - - operator: "template" - value: '[[[ return entity.attributes.preset_mode == "away" ]]]' - styles: - card: - - background-color: "var(--card-background-color)" - - box-shadow: "var( --ha-card-box-shadow)" - - transform: "scale(0.95)" - comfort: - card: - type: "custom:button-card" - entity: "[[[ return entity.entity_id ]]]" - template: "widget_icon" - icon: "mdi:car-seat-cooler" - tap_action: - action: "call-service" - service: "climate.set_preset_mode" - service_data: - entity_id: "[[[ return entity.entity_id ]]]" - preset_mode: "comfort" - styles: - card: - - background-color: "transparent" - - height: "42px" - - width: "42px" - - border-radius: "50%" - - box-shadow: "none" - state: - - operator: "template" - value: '[[[ return entity.attributes.preset_mode == "comfort" ]]]' - styles: - card: - - background-color: "var(--card-background-color)" - - box-shadow: "var( --ha-card-box-shadow)" - - transform: "scale(0.95)" - home: - card: - type: "custom:button-card" - entity: "[[[ return entity.entity_id ]]]" - template: "widget_icon" - icon: "mdi:home" - tap_action: - action: "call-service" - service: "climate.set_preset_mode" - service_data: - entity_id: "[[[ return entity.entity_id ]]]" - preset_mode: "home" - styles: - card: - - background-color: "transparent" - - height: "42px" - - width: "42px" - - border-radius: "50%" - - box-shadow: "none" - state: - - operator: "template" - value: '[[[ return entity.attributes.preset_mode == "home" ]]]' - styles: - card: - - background-color: "var(--card-background-color)" - - box-shadow: "var( --ha-card-box-shadow)" - - transform: "scale(0.95)" - sleep: - card: - type: "custom:button-card" - entity: "[[[ return entity.entity_id ]]]" - template: "widget_icon" - icon: "mdi:sleep" - tap_action: - action: "call-service" - service: "climate.set_preset_mode" - service_data: - entity_id: "[[[ return entity.entity_id ]]]" - preset_mode: "sleep" - styles: - card: - - background-color: "transparent" - - height: "42px" - - width: "42px" - - border-radius: "50%" - - box-shadow: "none" - state: - - operator: "template" - value: '[[[ return entity.attributes.preset_mode == "sleep" ]]]' - styles: - card: - - background-color: "var(--card-background-color)" - - box-shadow: "var( --ha-card-box-shadow)" - - transform: "scale(0.95)" - activity: - card: - type: "custom:button-card" - entity: "[[[ return entity.entity_id ]]]" - template: "widget_icon" - icon: "mdi:ticket" - tap_action: - action: "call-service" - service: "climate.set_preset_mode" - service_data: - entity_id: "[[[ return entity.entity_id ]]]" - preset_mode: "activity" - styles: - card: - - background-color: "transparent" - - height: "42px" - - width: "42px" - - border-radius: "50%" - - box-shadow: "none" - state: - - operator: "template" - value: '[[[ return entity.attributes.preset_mode == "activity" ]]]' - styles: - card: - - background-color: "var(--card-background-color)" - - box-shadow: "var( --ha-card-box-shadow)" - - transform: "scale(0.95)" - footer: - card: - type: "custom:button-card" - template: "popup_list_items" - custom_fields: - item1: - card: - type: "custom:button-card" - template: "popup_button_back" - item2: - card: - type: "custom:button-card" - template: "popup_button_power" - entity: "[[[ return entity.entity_id ]]]" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat_temperature.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat_temperature.yaml index ca5d7bbb4..5f41a6057 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat_temperature.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat_temperature.yaml @@ -68,46 +68,88 @@ popup_thermostat_temperature: - grid-template-areas: > [[[ var areas = []; - if (entity.attributes.hvac_modes.includes("auto")) { - areas.push("auto"); - } - if (entity.attributes.hvac_modes.includes("heat")) { - areas.push("heat"); - } - if (entity.attributes.hvac_modes.includes("cool")) { - areas.push("cool"); - } - if (entity.attributes.hvac_modes.includes("dry")) { - areas.push("dry"); - } - if (entity.attributes.hvac_modes.includes("fan_only")) { - areas.push("fan_only"); - } - if (entity.attributes.hvac_modes.includes("heat_cool")) { - areas.push("heat_cool"); + if !(variables.ulm_popup_thermostat_preset_mode){ + if (entity.attributes.hvac_modes.includes("auto")) { + areas.push("auto"); + } + if (entity.attributes.hvac_modes.includes("heat")) { + areas.push("heat"); + } + if (entity.attributes.hvac_modes.includes("cool")) { + areas.push("cool"); + } + if (entity.attributes.hvac_modes.includes("dry")) { + areas.push("dry"); + } + if (entity.attributes.hvac_modes.includes("fan_only")) { + areas.push("fan_only"); + } + if (entity.attributes.hvac_modes.includes("heat_cool")) { + areas.push("heat_cool"); + } + } else { + if (entity.attributes.preset_modes.includes("none")) { + areas.push("none"); + } + if (entity.attributes.preset_modes.includes("away")) { + areas.push("away"); + } + if (entity.attributes.preset_modes.includes("comfort")) { + areas.push("comfort"); + } + if (entity.attributes.preset_modes.includes("home")) { + areas.push("home"); + } + if (entity.attributes.preset_modes.includes("sleep")) { + areas.push("sleep"); + } + if (entity.attributes.preset_modes.includes("activity")) { + areas.push("activity"); + } } return "\"" + areas.join(" ") + "\""; ]]] - grid-template-columns: > [[[ var columns = []; - if (entity.attributes.hvac_modes.includes("auto")) { - columns.push("1fr"); - } - if (entity.attributes.hvac_modes.includes("heat")) { - columns.push("1fr"); - } - if (entity.attributes.hvac_modes.includes("cool")) { - columns.push("1fr"); - } - if (entity.attributes.hvac_modes.includes("dry")) { - columns.push("1fr"); - } - if (entity.attributes.hvac_modes.includes("fan_only")) { - columns.push("1fr"); - } - if (entity.attributes.hvac_modes.includes("heat_cool")) { - columns.push("1fr"); + if !(variables.ulm_popup_thermostat_preset_mode){ + if (entity.attributes.hvac_modes.includes("auto")) { + columns.push("1fr"); + } + if (entity.attributes.hvac_modes.includes("heat")) { + columns.push("1fr"); + } + if (entity.attributes.hvac_modes.includes("cool")) { + columns.push("1fr"); + } + if (entity.attributes.hvac_modes.includes("dry")) { + columns.push("1fr"); + } + if (entity.attributes.hvac_modes.includes("fan_only")) { + columns.push("1fr"); + } + if (entity.attributes.hvac_modes.includes("heat_cool")) { + columns.push("1fr"); + } + } else { + if (entity.attributes.preset_modes.includes("none")) { + columns.push("1fr"); + } + if (entity.attributes.preset_modes.includes("away")) { + columns.push("1fr"); + } + if (entity.attributes.preset_modes.includes("comfort")) { + columns.push("1fr"); + } + if (entity.attributes.preset_modes.includes("home")) { + columns.push("1fr"); + } + if (entity.attributes.preset_modes.includes("sleep")) { + columns.push("1fr"); + } + if (entity.attributes.preset_modes.includes("activity")) { + columns.push("1fr"); + } } return columns.join(" "); ]]] @@ -173,6 +215,60 @@ popup_thermostat_temperature: return "none"; } ]]] + none: + - display: > + [[[ + if (entity.attributes.preset_modes.includes("none")) { + return "block"; + } else { + return "none"; + } + ]]] + away: + - display: > + [[[ + if (entity.attributes.preset_modes.includes("away")) { + return "block"; + } else { + return "none"; + } + ]]] + comfort: + - display: > + [[[ + if (entity.attributes.preset_modes.includes("comfort")) { + return "block"; + } else { + return "none"; + } + ]]] + home: + - display: > + [[[ + if (entity.attributes.preset_modes.includes("home")) { + return "block"; + } else { + return "none"; + } + ]]] + sleep: + - display: > + [[[ + if (entity.attributes.preset_modes.includes("sleep")) { + return "block"; + } else { + return "none"; + } + ]]] + activity: + - display: > + [[[ + if (entity.attributes.preset_modes.includes("activity")) { + return "block"; + } else { + return "none"; + } + ]]] custom_fields: auto: card: @@ -330,6 +426,168 @@ popup_thermostat_temperature: - background-color: "var(--card-background-color)" - box-shadow: "var( --ha-card-box-shadow)" - transform: "scale(0.95)" + none: + card: + type: "custom:button-card" + entity: "[[[ return entity.entity_id ]]]" + template: "widget_icon" + icon: "mdi:toggle-switch-off" + tap_action: + action: "call-service" + service: "climate.set_preset_mode" + service_data: + entity_id: "[[[ return entity.entity_id ]]]" + preset_mode: "none" + styles: + card: + - background-color: "transparent" + - height: "42px" + - width: "42px" + - border-radius: "50%" + - box-shadow: "none" + state: + - operator: "template" + value: "[[[ return entity.attributes.preset_mode == 'none' ]]]" + styles: + card: + - background-color: "var(--card-background-color)" + - box-shadow: "var( --ha-card-box-shadow)" + - transform: "scale(0.95)" + away: + card: + type: "custom:button-card" + entity: "[[[ return entity.entity_id ]]]" + template: "widget_icon" + icon: "mdi:home-switch-outline" + tap_action: + action: "call-service" + service: "climate.set_preset_mode" + service_data: + entity_id: "[[[ return entity.entity_id ]]]" + preset_mode: "away" + styles: + card: + - background-color: "transparent" + - height: "42px" + - width: "42px" + - border-radius: "50%" + - box-shadow: "none" + state: + - operator: "template" + value: "[[[ return entity.attributes.preset_mode == 'away' ]]]" + styles: + card: + - background-color: "var(--card-background-color)" + - box-shadow: "var( --ha-card-box-shadow)" + - transform: "scale(0.95)" + comfort: + card: + type: "custom:button-card" + entity: "[[[ return entity.entity_id ]]]" + template: "widget_icon" + icon: "mdi:car-seat-cooler" + tap_action: + action: "call-service" + service: "climate.set_preset_mode" + service_data: + entity_id: "[[[ return entity.entity_id ]]]" + preset_mode: "comfort" + styles: + card: + - background-color: "transparent" + - height: "42px" + - width: "42px" + - border-radius: "50%" + - box-shadow: "none" + state: + - operator: "template" + value: "[[[ return entity.attributes.preset_mode == 'comfort' ]]]" + styles: + card: + - background-color: "var(--card-background-color)" + - box-shadow: "var( --ha-card-box-shadow)" + - transform: "scale(0.95)" + home: + card: + type: "custom:button-card" + entity: "[[[ return entity.entity_id ]]]" + template: "widget_icon" + icon: "mdi:home" + tap_action: + action: "call-service" + service: "climate.set_preset_mode" + service_data: + entity_id: "[[[ return entity.entity_id ]]]" + preset_mode: "home" + styles: + card: + - background-color: "transparent" + - height: "42px" + - width: "42px" + - border-radius: "50%" + - box-shadow: "none" + state: + - operator: "template" + value: "[[[ return entity.attributes.preset_mode == 'home' ]]]" + styles: + card: + - background-color: "var(--card-background-color)" + - box-shadow: "var( --ha-card-box-shadow)" + - transform: "scale(0.95)" + sleep: + card: + type: "custom:button-card" + entity: "[[[ return entity.entity_id ]]]" + template: "widget_icon" + icon: "mdi:sleep" + tap_action: + action: "call-service" + service: "climate.set_preset_mode" + service_data: + entity_id: "[[[ return entity.entity_id ]]]" + preset_mode: "sleep" + styles: + card: + - background-color: "transparent" + - height: "42px" + - width: "42px" + - border-radius: "50%" + - box-shadow: "none" + state: + - operator: "template" + value: "[[[ return entity.attributes.preset_mode == 'sleep' ]]]" + styles: + card: + - background-color: "var(--card-background-color)" + - box-shadow: "var( --ha-card-box-shadow)" + - transform: "scale(0.95)" + activity: + card: + type: "custom:button-card" + entity: "[[[ return entity.entity_id ]]]" + template: "widget_icon" + icon: "mdi:ticket" + tap_action: + action: "call-service" + service: "climate.set_preset_mode" + service_data: + entity_id: "[[[ return entity.entity_id ]]]" + preset_mode: "activity" + styles: + card: + - background-color: "transparent" + - height: "42px" + - width: "42px" + - border-radius: "50%" + - box-shadow: "none" + state: + - operator: "template" + value: "[[[ return entity.attributes.preset_mode == 'activity' ]]]" + styles: + card: + - background-color: "var(--card-background-color)" + - box-shadow: "var( --ha-card-box-shadow)" + - transform: "scale(0.95)" footer: card: type: "custom:button-card" From 6df5dd2d237e09dee8a4c91e0d75fad6057c2cb8 Mon Sep 17 00:00:00 2001 From: basbruss <68892092+basbruss@users.noreply.github.com> Date: Mon, 5 Sep 2022 07:01:25 +0200 Subject: [PATCH 06/21] Initial updates for browser_mod 2.0.0 --- .devcontainer/post-create.sh | 4 ++-- .../popup_buttons/popup_button_back.yaml | 2 +- .../popup_templates/popups/popup_light.yaml | 15 ++++++------ .../popups/popup_media_player.yaml | 15 ++++++------ .../popups/popup_power_outlet.yaml | 23 ++++++++++--------- .../popups/popup_thermostat.yaml | 15 ++++++------ .../popup_templates/popups/popup_weather.yaml | 15 ++++++------ 7 files changed, 47 insertions(+), 42 deletions(-) diff --git a/.devcontainer/post-create.sh b/.devcontainer/post-create.sh index 9b15671b0..f5fdb518f 100755 --- a/.devcontainer/post-create.sh +++ b/.devcontainer/post-create.sh @@ -45,14 +45,14 @@ cd /tmp # Install dependency modules ## Browser mod echo "Installing Custom Component: Browser Mod" -wget https://github.com/thomasloven/hass-browser_mod/archive/refs/tags/1.5.1.tar.gz -O browser_mod.tar.gz +wget https://github.com/thomasloven/hass-browser_mod/archive/refs/tags/2.1.0.tar.gz -O browser_mod.tar.gz tar -xvf browser_mod.tar.gz rm -rf /config/custom_components/browser_mod mv hass-browser_mod*/custom_components/browser_mod /config/custom_components/browser_mod ## virtual echo "Installing Custom Component: Virtual" -wget https://github.com/twrecked/hass-virtual/archive/refs/tags/v0.7.5.tar.gz -O virtual.tar.gz +wget https://github.com/twrecked/hass-virtual/archive/refs/tags/v0.7.7.tar.gz -O virtual.tar.gz tar -xvf virtual.tar.gz rm -rf /config/custom_components/virtual mv hass-virtual*/custom_components/virtual /config/custom_components/virtual diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popup_buttons/popup_button_back.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popup_buttons/popup_button_back.yaml index dd3ac5aef..d16278b1b 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popup_buttons/popup_button_back.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popup_buttons/popup_button_back.yaml @@ -16,4 +16,4 @@ popup_button_back: tap_action: action: "fire-dom-event" browser_mod: - command: "close_popup" + service: "browser_mod.close_popup" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light.yaml index 2b70809ac..b37999344 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light.yaml @@ -3,10 +3,11 @@ popup_light: hold_action: action: "fire-dom-event" browser_mod: - command: "popup" - large: true - hide_header: true - card: - type: "custom:button-card" - template: "popup_light_brightness" - entity: "[[[ return entity.entity_id; ]]]" + service: "browser_mod.popup" + data: + large: true + hide_header: true + card: + type: "custom:button-card" + template: "popup_light_brightness" + entity: "[[[ return entity.entity_id; ]]]" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player.yaml index fa6fd06ee..ad7d94c2f 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player.yaml @@ -3,10 +3,11 @@ popup_media_player: hold_action: action: "fire-dom-event" browser_mod: - command: "popup" - large: true - hide_header: true - card: - type: "custom:button-card" - template: "popup_media_player_infos" - entity: "[[[ return entity.entity_id; ]]]" + service: "browser_mod.popup" + data: + large: true + hide_header: true + card: + type: "custom:button-card" + template: "popup_media_player_infos" + entity: "[[[ return entity.entity_id; ]]]" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet.yaml index 095514343..8a254a55a 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet.yaml @@ -3,14 +3,15 @@ popup_power_outlet: hold_action: action: "fire-dom-event" browser_mod: - command: "popup" - large: true - hide_header: true - card: - type: "custom:button-card" - template: "popup_power_outlet_stats" - entity: "[[[ return entity.entity_id ]]]" - variables: - ulm_popup_power_outlet_sensor1: "[[[ return variables.ulm_popup_power_outlet_sensor1 ]]]" - ulm_popup_power_outlet_sensor2: "[[[ return variables.ulm_popup_power_outlet_sensor2 ]]]" - ulm_popup_power_outlet_graph_sensor: "[[[ return variables.ulm_popup_power_outlet_graph_sensor ]]]" + service: "browser_mod.popup" + data: + large: true + hide_header: true + card: + type: "custom:button-card" + template: "popup_power_outlet_stats" + entity: "[[[ return entity.entity_id ]]]" + variables: + ulm_popup_power_outlet_sensor1: "[[[ return variables.ulm_popup_power_outlet_sensor1 ]]]" + ulm_popup_power_outlet_sensor2: "[[[ return variables.ulm_popup_power_outlet_sensor2 ]]]" + ulm_popup_power_outlet_graph_sensor: "[[[ return variables.ulm_popup_power_outlet_graph_sensor ]]]" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat.yaml index 9735668a2..ffd91119b 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat.yaml @@ -3,10 +3,11 @@ popup_thermostat: hold_action: action: "fire-dom-event" browser_mod: - command: "popup" - large: true - hide_header: true - card: - type: "custom:button-card" - template: "popup_thermostat_temperature" - entity: "[[[ return entity.entity_id ]]]" + service: "browser_mod.popup" + data: + large: true + hide_header: true + card: + type: "custom:button-card" + template: "popup_thermostat_temperature" + entity: "[[[ return entity.entity_id ]]]" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather.yaml index c225df1ba..a73f8514f 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather.yaml @@ -3,10 +3,11 @@ popup_weather: hold_action: action: "fire-dom-event" browser_mod: - command: "popup" - large: true - hide_header: true - card: - type: "custom:button-card" - template: "popup_weather_forecast" - entity: "[[[ return entity.entity_id; ]]]" + service: "browser_mod.popup" + data: + large: true + hide_header: true + card: + type: "custom:button-card" + template: "popup_weather_forecast" + entity: "[[[ return entity.entity_id; ]]]" From 2d4fd8a0cfb466bb146ee66299ea479acaa0af86 Mon Sep 17 00:00:00 2001 From: basbruss <68892092+basbruss@users.noreply.github.com> Date: Mon, 5 Sep 2022 08:02:18 +0200 Subject: [PATCH 07/21] change data type of card --- .../ulm_templates/popup_templates/popups/popup_light.yaml | 2 +- .../popup_templates/popups/popup_media_player.yaml | 2 +- .../popup_templates/popups/popup_power_outlet.yaml | 2 +- .../ulm_templates/popup_templates/popups/popup_thermostat.yaml | 2 +- .../ulm_templates/popup_templates/popups/popup_weather.yaml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light.yaml index b37999344..0d6483c17 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light.yaml @@ -7,7 +7,7 @@ popup_light: data: large: true hide_header: true - card: + content: type: "custom:button-card" template: "popup_light_brightness" entity: "[[[ return entity.entity_id; ]]]" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player.yaml index ad7d94c2f..6a17e12ca 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player.yaml @@ -7,7 +7,7 @@ popup_media_player: data: large: true hide_header: true - card: + content: type: "custom:button-card" template: "popup_media_player_infos" entity: "[[[ return entity.entity_id; ]]]" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet.yaml index 8a254a55a..ff2eb9eff 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet.yaml @@ -7,7 +7,7 @@ popup_power_outlet: data: large: true hide_header: true - card: + content: type: "custom:button-card" template: "popup_power_outlet_stats" entity: "[[[ return entity.entity_id ]]]" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat.yaml index ffd91119b..889fbf74f 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat.yaml @@ -7,7 +7,7 @@ popup_thermostat: data: large: true hide_header: true - card: + content: type: "custom:button-card" template: "popup_thermostat_temperature" entity: "[[[ return entity.entity_id ]]]" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather.yaml index a73f8514f..ffb255004 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather.yaml @@ -7,7 +7,7 @@ popup_weather: data: large: true hide_header: true - card: + content: type: "custom:button-card" template: "popup_weather_forecast" entity: "[[[ return entity.entity_id; ]]]" From a635068e50a86f2f34434ea9a82f86c27159afe0 Mon Sep 17 00:00:00 2001 From: basbruss <68892092+basbruss@users.noreply.github.com> Date: Mon, 5 Sep 2022 09:02:21 +0200 Subject: [PATCH 08/21] custom_actions --- .../ulm_templates/actions/actions_card.yaml | 369 +++++++-------- .../ulm_templates/actions/actions_icon.yaml | 431 +++++++++--------- .../ulm_templates/actions/actions_name.yaml | 393 ++++++++-------- 3 files changed, 601 insertions(+), 592 deletions(-) diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card.yaml index 3d5902ee4..a90c8b2b9 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card.yaml @@ -35,77 +35,78 @@ ulm_actions_card: navigation_path: "[[[ return variables.ulm_card_tap_action == 'navigate' ? variables.ulm_card_tap_navigate_path : '/0' ]]]" haptic: "[[[ return variables.ulm_card_tap_haptic != null ? variables.ulm_card_tap_haptic : 'none' ]]]" service: > - [[[ - var action = variables.ulm_card_tap_action; + [[[ + var action = variables.ulm_card_tap_action; - if (action == 'adaptive'){ - return 'input_select.select_option'; - } + if (action == 'adaptive'){ + return 'input_select.select_option'; + } - return variables.ulm_card_tap_service; - ]]] + return variables.ulm_card_tap_service; + ]]] service_data: > - [[[ - var action = variables.ulm_card_tap_action; + [[[ + var action = variables.ulm_card_tap_action; - if (action == 'adaptive'){ - return { - 'option': variables.ulm_input_select_option, - 'entity_id': variables.ulm_input_select - }; - } + if (action == 'adaptive'){ + return { + 'option': variables.ulm_input_select_option, + 'entity_id': variables.ulm_input_select + }; + } - return variables.ulm_card_tap_service_data; - ]]] + return variables.ulm_card_tap_service_data; + ]]] browser_mod: - command: "popup" - large: true - hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - card: - type: "custom:button-card" - template: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'template' in popup_config) { - return popup_config.template; - } + service: "browser_mod.popup" + data: + large: true + hide_header: true + style: + .: | + :host { + --mdc-theme-surface: var(--primary-background-color); + --secondary-background-color: var(--primary-background-color); } - ]]] - entity: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'entity' in popup_config) { - return popup_config.entity; - } + $: | + .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { + border-radius: 0px; } + :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { + padding: 20px 24px; + } + content: + type: "custom:button-card" + template: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'template' in popup_config) { + return popup_config.template; + } + } + ]]] + entity: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'entity' in popup_config) { + return popup_config.entity; + } + } - return (entity != null) ? entity.entity_id : null; - ]]] - variables: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) { - return popup_config.popup_variables; + return (entity != null) ? entity.entity_id : null; + ]]] + variables: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) { + return popup_config.popup_variables; + } } - } - return {}; - ]]] + return {}; + ]]] hold_action: action: > [[[ @@ -140,77 +141,78 @@ ulm_actions_card: navigation_path: "[[[ return variables.ulm_card_hold_action == 'navigate' ? variables.ulm_card_hold_navigate_path : '/0' ]]]" haptic: "[[[ return variables.ulm_card_hold_haptic != null ? variables.ulm_card_hold_haptic : 'none' ]]]" service: > - [[[ - var action = variables.ulm_card_hold_action; + [[[ + var action = variables.ulm_card_hold_action; - if (action == 'adaptive'){ - return 'input_select.select_option'; - } + if (action == 'adaptive'){ + return 'input_select.select_option'; + } - return variables.ulm_card_hold_service; - ]]] + return variables.ulm_card_hold_service; + ]]] service_data: > - [[[ - var action = variables.ulm_card_hold_action; + [[[ + var action = variables.ulm_card_hold_action; - if (action == 'adaptive'){ - return { - 'option': variables.ulm_input_select_option, - 'entity_id': variables.ulm_input_select - }; - } + if (action == 'adaptive'){ + return { + 'option': variables.ulm_input_select_option, + 'entity_id': variables.ulm_input_select + }; + } - return variables.ulm_card_hold_service_data; - ]]] + return variables.ulm_card_hold_service_data; + ]]] browser_mod: - command: "popup" - large: true - hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - card: - type: "custom:button-card" - template: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'template' in popup_config) { - return popup_config.template; - } + service: "browser_mod.popup" + data: + large: true + hide_header: true + style: + .: | + :host { + --mdc-theme-surface: var(--primary-background-color); + --secondary-background-color: var(--primary-background-color); } - ]]] - entity: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'entity' in popup_config) { - return popup_config.entity; - } + $: | + .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { + border-radius: 0px; + } + :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { + padding: 20px 24px; } + content: + type: "custom:button-card" + template: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'template' in popup_config) { + return popup_config.template; + } + } + ]]] + entity: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'entity' in popup_config) { + return popup_config.entity; + } + } - return (entity != null) ? entity.entity_id : null; - ]]] - variables: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) { - return popup_config.popup_variables; + return (entity != null) ? entity.entity_id : null; + ]]] + variables: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) { + return popup_config.popup_variables; + } } - } - return {}; - ]]] + return {}; + ]]] double_tap_action: action: > [[[ @@ -245,74 +247,75 @@ ulm_actions_card: navigation_path: "[[[ return variables.ulm_card_double_tap_action == 'navigate' ? variables.ulm_card_double_tap_navigate_path : '/0' ]]]" haptic: "[[[ return variables.ulm_card_double_tap_haptic != null ? variables.ulm_card_double_tap_haptic : 'none' ]]]" service: > - [[[ - var action = variables.ulm_card_double_tap_action; + [[[ + var action = variables.ulm_card_double_tap_action; - if (action == 'adaptive'){ - return 'input_select.select_option'; - } + if (action == 'adaptive'){ + return 'input_select.select_option'; + } - return variables.ulm_card_double_tap_service; - ]]] + return variables.ulm_card_double_tap_service; + ]]] service_data: > - [[[ - var action = variables.ulm_card_double_tap_action; + [[[ + var action = variables.ulm_card_double_tap_action; - if (action == 'adaptive'){ - return { - 'option': variables.ulm_input_select_option, - 'entity_id': variables.ulm_input_select - }; - } + if (action == 'adaptive'){ + return { + 'option': variables.ulm_input_select_option, + 'entity_id': variables.ulm_input_select + }; + } - return variables.ulm_card_double_tap_service_data; - ]]] + return variables.ulm_card_double_tap_service_data; + ]]] browser_mod: - command: "popup" - large: true - hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - card: - type: "custom:button-card" - template: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'template' in popup_config) { - return popup_config.template; - } + service: "browser_mod.popup" + data: + large: true + hide_header: true + style: + .: | + :host { + --mdc-theme-surface: var(--primary-background-color); + --secondary-background-color: var(--primary-background-color); } - ]]] - entity: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'entity' in popup_config) { - return popup_config.entity; - } + $: | + .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { + border-radius: 0px; + } + :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { + padding: 20px 24px; } + content: + type: "custom:button-card" + template: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'template' in popup_config) { + return popup_config.template; + } + } + ]]] + entity: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'entity' in popup_config) { + return popup_config.entity; + } + } - return (entity != null) ? entity.entity_id : null; - ]]] - variables: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) { - return popup_config.popup_variables; + return (entity != null) ? entity.entity_id : null; + ]]] + variables: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) { + return popup_config.popup_variables; + } } - } - return {}; - ]]] + return {}; + ]]] diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_icon.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_icon.yaml index e130f224a..cf226afcf 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_icon.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_icon.yaml @@ -35,94 +35,95 @@ ulm_actions_icon: navigation_path: "[[[ return variables.ulm_icon_tap_action == 'navigate' ? variables.ulm_icon_tap_navigate_path : '/0' ]]]" haptic: "[[[ return variables.ulm_icon_tap_haptic != null ? variables.ulm_icon_tap_haptic : 'none' ]]]" service: > - [[[ - var action = variables.ulm_icon_tap_action; + [[[ + var action = variables.ulm_icon_tap_action; - if (action == 'adaptive'){ - return 'input_select.select_option'; - } + if (action == 'adaptive'){ + return 'input_select.select_option'; + } - return variables.ulm_icon_tap_service; - ]]] + return variables.ulm_icon_tap_service; + ]]] service_data: > - [[[ - var action = variables.ulm_icon_tap_action; - - if (action == 'adaptive'){ - return { - 'option': variables.ulm_input_select_option, - 'entity_id': variables.ulm_input_select - }; - } + [[[ + var action = variables.ulm_icon_tap_action; - return variables.ulm_icon_tap_service_data; - ]]] + if (action == 'adaptive'){ + return { + 'option': variables.ulm_input_select_option, + 'entity_id': variables.ulm_input_select + }; + } + + return variables.ulm_icon_tap_service_data; + ]]] browser_mod: - command: "popup" - large: true - hide_header: true - style: - $: | - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - @media (max-width: 450px), (max-height: 500px) { - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - } - .: | - @media (max-width: 450px), (max-height: 500px) { - ha-dialog { - --ha-card-border-radius: 0px; + service: "browser_mod.popup" + data: + large: true + hide_header: true + style: + $: | + :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { + padding: 20px 24px; } - } - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - card: - type: "custom:button-card" - template: > - [[[ - if (variables.ulm_card_light_enable_popup){ - return 'popup_light_brightness' + @media (max-width: 450px), (max-height: 500px) { + .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { + border-radius: 0px; + } } - if (variables.ulm_card_thermostat_enable_popup){ - return 'popup_thermostat_temperature' + .: | + @media (max-width: 450px), (max-height: 500px) { + ha-dialog { + --ha-card-border-radius: 0px; + } } - if (variables.ulm_card_media_player_enable_popup){ - return 'popup_media_player_infos' + :host { + --mdc-theme-surface: var(--primary-background-color); + --secondary-background-color: var(--primary-background-color); } + content: + type: "custom:button-card" + template: > + [[[ + if (variables.ulm_card_light_enable_popup){ + return 'popup_light_brightness' + } + if (variables.ulm_card_thermostat_enable_popup){ + return 'popup_thermostat_temperature' + } + if (variables.ulm_card_media_player_enable_popup){ + return 'popup_media_player_infos' + } - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'template' in popup_config) { - return popup_config.template; + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'template' in popup_config) { + return popup_config.template; + } } - } - ]]] - entity: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'entity' in popup_config) { - return popup_config.entity; + ]]] + entity: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'entity' in popup_config) { + return popup_config.entity; + } } - } - return (entity != null) ? entity.entity_id : null; - ]]] - variables: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) { - return popup_config.popup_variables; + return (entity != null) ? entity.entity_id : null; + ]]] + variables: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) { + return popup_config.popup_variables; + } } - } - return {}; - ]]] + return {}; + ]]] hold_action: action: > [[[ @@ -157,94 +158,95 @@ ulm_actions_icon: navigation_path: "[[[ return variables.ulm_icon_hold_action == 'navigate' ? variables.ulm_icon_hold_navigate_path : '/0' ]]]" haptic: "[[[ return variables.ulm_icon_hold_haptic != null ? variables.ulm_icon_hold_haptic : 'none' ]]]" service: > - [[[ - var action = variables.ulm_icon_hold_action; + [[[ + var action = variables.ulm_icon_hold_action; - if (action == 'adaptive'){ - return 'input_select.select_option'; - } + if (action == 'adaptive'){ + return 'input_select.select_option'; + } - return variables.ulm_icon_hold_service; - ]]] + return variables.ulm_icon_hold_service; + ]]] service_data: > - [[[ - var action = variables.ulm_icon_hold_action; - - if (action == 'adaptive'){ - return { - 'option': variables.ulm_input_select_option, - 'entity_id': variables.ulm_input_select - }; - } + [[[ + var action = variables.ulm_icon_hold_action; + + if (action == 'adaptive'){ + return { + 'option': variables.ulm_input_select_option, + 'entity_id': variables.ulm_input_select + }; + } - return variables.ulm_icon_hold_service_data; - ]]] + return variables.ulm_icon_hold_service_data; + ]]] browser_mod: - command: "popup" - large: true - hide_header: true - style: - $: | - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - @media (max-width: 450px), (max-height: 500px) { - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; + service: "browser_mod.popup" + data: + large: true + hide_header: true + style: + $: | + :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { + padding: 20px 24px; } - } - .: | - @media (max-width: 450px), (max-height: 500px) { - ha-dialog { - --ha-card-border-radius: 0px; - } - } - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - card: - type: "custom:button-card" - template: > - [[[ - if (variables.ulm_card_light_enable_popup){ - return 'popup_light_brightness' + @media (max-width: 450px), (max-height: 500px) { + .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { + border-radius: 0px; + } } - if (variables.ulm_card_thermostat_enable_popup){ - return 'popup_thermostat_temperature' + .: | + @media (max-width: 450px), (max-height: 500px) { + ha-dialog { + --ha-card-border-radius: 0px; + } } - if (variables.ulm_card_media_player_enable_popup){ - return 'popup_media_player_infos' + :host { + --mdc-theme-surface: var(--primary-background-color); + --secondary-background-color: var(--primary-background-color); } + content: + type: "custom:button-card" + template: > + [[[ + if (variables.ulm_card_light_enable_popup){ + return 'popup_light_brightness' + } + if (variables.ulm_card_thermostat_enable_popup){ + return 'popup_thermostat_temperature' + } + if (variables.ulm_card_media_player_enable_popup){ + return 'popup_media_player_infos' + } - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'template' in popup_config) { - return popup_config.template; + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'template' in popup_config) { + return popup_config.template; + } } - } - ]]] - entity: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'entity' in popup_config) { - return popup_config.entity; + ]]] + entity: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'entity' in popup_config) { + return popup_config.entity; + } } - } - return (entity != null) ? entity.entity_id : null; - ]]] - variables: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) { - return popup_config.popup_variables; + return (entity != null) ? entity.entity_id : null; + ]]] + variables: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) { + return popup_config.popup_variables; + } } - } - return {}; - ]]] + return {}; + ]]] double_tap_action: action: > [[[ @@ -283,81 +285,82 @@ ulm_actions_icon: navigation_path: "[[[ return variables.ulm_icon_double_tap_action == 'navigate' ? variables.ulm_icon_double_tap_navigate_path : '/0' ]]]" haptic: "[[[ return variables.ulm_icon_double_tap_haptic != null ? variables.ulm_icon_double_tap_haptic : 'none' ]]]" service: > - [[[ - var action = variables.ulm_icon_double_tap_action; + [[[ + var action = variables.ulm_icon_double_tap_action; - if (action == 'adaptive'){ - return 'input_select.select_option'; - } + if (action == 'adaptive'){ + return 'input_select.select_option'; + } - return variables.ulm_icon_double_tap_service; - ]]] + return variables.ulm_icon_double_tap_service; + ]]] service_data: > - [[[ - var action = variables.ulm_icon_double_tap_action; - - if (action == 'adaptive'){ - return { - 'option': variables.ulm_input_select_option, - 'entity_id': variables.ulm_input_select - }; - } + [[[ + var action = variables.ulm_icon_double_tap_action; - return variables.ulm_icon_double_tap_service_data; - ]]] + if (action == 'adaptive'){ + return { + 'option': variables.ulm_input_select_option, + 'entity_id': variables.ulm_input_select + }; + } + + return variables.ulm_icon_double_tap_service_data; + ]]] browser_mod: - command: "popup" - large: true - hide_header: true - style: - $: | - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - @media (max-width: 450px), (max-height: 500px) { - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; + service: "browser_mod.popup" + data: + large: true + hide_header: true + style: + $: | + :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { + padding: 20px 24px; } - } - .: | - @media (max-width: 450px), (max-height: 500px) { - ha-dialog { - --ha-card-border-radius: 0px; - } - } - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - card: - type: "custom:button-card" - template: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'template' in popup_config) { - return popup_config.template; + @media (max-width: 450px), (max-height: 500px) { + .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { + border-radius: 0px; } } - ]]] - entity: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'entity' in popup_config) { - return popup_config.entity; + .: | + @media (max-width: 450px), (max-height: 500px) { + ha-dialog { + --ha-card-border-radius: 0px; } } + :host { + --mdc-theme-surface: var(--primary-background-color); + --secondary-background-color: var(--primary-background-color); + } + content: + type: "custom:button-card" + template: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'template' in popup_config) { + return popup_config.template; + } + } + ]]] + entity: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'entity' in popup_config) { + return popup_config.entity; + } + } - return (entity != null) ? entity.entity_id : null; - ]]] - variables: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) { - return popup_config.popup_variables; + return (entity != null) ? entity.entity_id : null; + ]]] + variables: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) { + return popup_config.popup_variables; + } } - } - return {}; - ]]] + return {}; + ]]] diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_name.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_name.yaml index 637a0c304..9914c693e 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_name.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_name.yaml @@ -35,84 +35,85 @@ ulm_actions_name: navigation_path: "[[[ return variables.ulm_name_tap_action == 'navigate' ? variables.ulm_name_tap_navigate_path : '/0' ]]]" haptic: "[[[ return variables.ulm_name_tap_haptic != null ? variables.ulm_name_tap_haptic : 'none' ]]]" service: > - [[[ - var action = variables.ulm_name_tap_action; + [[[ + var action = variables.ulm_name_tap_action; - if (action == 'adaptive'){ - return 'input_select.select_option'; - } + if (action == 'adaptive'){ + return 'input_select.select_option'; + } - return variables.ulm_name_tap_service; - ]]] + return variables.ulm_name_tap_service; + ]]] service_data: > - [[[ - var action = variables.ulm_name_tap_action; + [[[ + var action = variables.ulm_name_tap_action; - if (action == 'adaptive'){ - return { - 'option': variables.ulm_input_select_option, - 'entity_id': variables.ulm_input_select - }; - } + if (action == 'adaptive'){ + return { + 'option': variables.ulm_input_select_option, + 'entity_id': variables.ulm_input_select + }; + } - return variables.ulm_name_tap_service_data; - ]]] + return variables.ulm_name_tap_service_data; + ]]] browser_mod: - command: "popup" - large: true - hide_header: true - style: - $: | - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - @media (max-width: 450px), (max-height: 500px) { - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; + service: "browser_mod.popup" + data: + large: true + hide_header: true + style: + $: | + :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { + padding: 20px 24px; } - } - .: | - @media (max-width: 450px), (max-height: 500px) { - ha-dialog { - --ha-card-border-radius: 0px; - } - } - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - card: - type: "custom:button-card" - template: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'template' in popup_config) { - return popup_config.template; + @media (max-width: 450px), (max-height: 500px) { + .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { + border-radius: 0px; } } - ]]] - entity: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'entity' in popup_config) { - return popup_config.entity; + .: | + @media (max-width: 450px), (max-height: 500px) { + ha-dialog { + --ha-card-border-radius: 0px; } } + :host { + --mdc-theme-surface: var(--primary-background-color); + --secondary-background-color: var(--primary-background-color); + } + content: + type: "custom:button-card" + template: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'template' in popup_config) { + return popup_config.template; + } + } + ]]] + entity: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'entity' in popup_config) { + return popup_config.entity; + } + } - return (entity != null) ? entity.entity_id : null; - ]]] - variables: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) { - return popup_config.popup_variables; + return (entity != null) ? entity.entity_id : null; + ]]] + variables: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) { + return popup_config.popup_variables; + } } - } - return {}; - ]]] + return {}; + ]]] hold_action: action: > [[[ @@ -147,84 +148,85 @@ ulm_actions_name: navigation_path: "[[[ return variables.ulm_name_hold_action == 'navigate' ? variables.ulm_name_hold_navigate_path : '/0' ]]]" haptic: "[[[ return variables.ulm_name_hold_haptic != null ? variables.ulm_name_hold_haptic : 'none' ]]]" service: > - [[[ - var action = variables.ulm_name_hold_action; + [[[ + var action = variables.ulm_name_hold_action; - if (action == 'adaptive'){ - return 'input_select.select_option'; - } + if (action == 'adaptive'){ + return 'input_select.select_option'; + } - return variables.ulm_name_hold_service; - ]]] + return variables.ulm_name_hold_service; + ]]] service_data: > - [[[ - var action = variables.ulm_name_hold_action; + [[[ + var action = variables.ulm_name_hold_action; - if (action == 'adaptive'){ - return { - 'option': variables.ulm_input_select_option, - 'entity_id': variables.ulm_input_select - }; - } + if (action == 'adaptive'){ + return { + 'option': variables.ulm_input_select_option, + 'entity_id': variables.ulm_input_select + }; + } - return variables.ulm_card_name_service_data; - ]]] + return variables.ulm_card_name_service_data; + ]]] browser_mod: - command: "popup" - large: true - hide_header: true - style: - $: | - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - @media (max-width: 450px), (max-height: 500px) { - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - } - .: | - @media (max-width: 450px), (max-height: 500px) { - ha-dialog { - --ha-card-border-radius: 0px; + service: "browser_mod.popup" + data: + large: true + hide_header: true + style: + $: | + :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { + padding: 20px 24px; } - } - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - card: - type: "custom:button-card" - template: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'template' in popup_config) { - return popup_config.template; + @media (max-width: 450px), (max-height: 500px) { + .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { + border-radius: 0px; } } - ]]] - entity: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'entity' in popup_config) { - return popup_config.entity; + .: | + @media (max-width: 450px), (max-height: 500px) { + ha-dialog { + --ha-card-border-radius: 0px; } } + :host { + --mdc-theme-surface: var(--primary-background-color); + --secondary-background-color: var(--primary-background-color); + } + content: + type: "custom:button-card" + template: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'template' in popup_config) { + return popup_config.template; + } + } + ]]] + entity: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'entity' in popup_config) { + return popup_config.entity; + } + } - return (entity != null) ? entity.entity_id : null; - ]]] - variables: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) { - return popup_config.popup_variables; + return (entity != null) ? entity.entity_id : null; + ]]] + variables: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) { + return popup_config.popup_variables; + } } - } - return {}; - ]]] + return {}; + ]]] double_tap_action: action: > [[[ @@ -259,81 +261,82 @@ ulm_actions_name: navigation_path: "[[[ return variables.ulm_name_double_tap_action == 'navigate' ? variables.ulm_name_double_tap_navigate_path : '/0' ]]]" haptic: "[[[ return variables.ulm_name_double_tap_haptic != null ? variables.ulm_name_double_tap_haptic : 'none' ]]]" service: > - [[[ - var action = variables.ulm_name_double_tap_action; + [[[ + var action = variables.ulm_name_double_tap_action; - if (action == 'adaptive'){ - return 'input_select.select_option'; - } + if (action == 'adaptive'){ + return 'input_select.select_option'; + } - return variables.ulm_name_double_tap_service; - ]]] + return variables.ulm_name_double_tap_service; + ]]] service_data: > - [[[ - var action = variables.ulm_name_double_tap_action; + [[[ + var action = variables.ulm_name_double_tap_action; - if (action == 'adaptive'){ - return { - 'option': variables.ulm_input_select_option, - 'entity_id': variables.ulm_input_select - }; - } + if (action == 'adaptive'){ + return { + 'option': variables.ulm_input_select_option, + 'entity_id': variables.ulm_input_select + }; + } - return variables.ulm_name_double_tap_service_data; - ]]] + return variables.ulm_name_double_tap_service_data; + ]]] browser_mod: - command: "popup" - large: true - hide_header: true - style: - $: | - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - @media (max-width: 450px), (max-height: 500px) { - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - } - .: | - @media (max-width: 450px), (max-height: 500px) { - ha-dialog { - --ha-card-border-radius: 0px; + service: "browser_mod.popup" + data: + large: true + hide_header: true + style: + $: | + :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { + padding: 20px 24px; } - } - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - card: - type: "custom:button-card" - template: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'template' in popup_config) { - return popup_config.template; + @media (max-width: 450px), (max-height: 500px) { + .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { + border-radius: 0px; } } - ]]] - entity: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'entity' in popup_config) { - return popup_config.entity; + .: | + @media (max-width: 450px), (max-height: 500px) { + ha-dialog { + --ha-card-border-radius: 0px; } } + :host { + --mdc-theme-surface: var(--primary-background-color); + --secondary-background-color: var(--primary-background-color); + } + content: + type: "custom:button-card" + template: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'template' in popup_config) { + return popup_config.template; + } + } + ]]] + entity: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'entity' in popup_config) { + return popup_config.entity; + } + } - return (entity != null) ? entity.entity_id : null; - ]]] - variables: > - [[[ - if (variables.ulm_custom_popup != null ){ - let popup_config = variables.ulm_custom_popup; - if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) { - return popup_config.popup_variables; + return (entity != null) ? entity.entity_id : null; + ]]] + variables: > + [[[ + if (variables.ulm_custom_popup != null ){ + let popup_config = variables.ulm_custom_popup; + if ((typeof popup_config === 'object') && 'popup_variables' in popup_config) { + return popup_config.popup_variables; + } } - } - return {}; - ]]] + return {}; + ]]] From 14c826c25c1e3bda33ad4d2095f8d9b24708414a Mon Sep 17 00:00:00 2001 From: basbruss <68892092+basbruss@users.noreply.github.com> Date: Mon, 5 Sep 2022 09:27:46 +0200 Subject: [PATCH 09/21] Update internal linking --- .../cards/card_media_player.yaml | 45 ++++++----- .../popups/popup_light_brightness.yaml | 78 ++++++++++--------- .../popups/popup_light_color.yaml | 78 ++++++++++--------- .../popups/popup_light_color_temp.yaml | 78 ++++++++++--------- .../popups/popup_media_player_volume.yaml | 39 +++++----- .../popups/popup_power_outlet_history.yaml | 47 +++++------ .../popups/popup_power_outlet_stats.yaml | 47 +++++------ .../popups/popup_weather_forecast.yaml | 39 +++++----- .../popups/popup_weather_radar.yaml | 39 +++++----- 9 files changed, 252 insertions(+), 238 deletions(-) diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_media_player.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_media_player.yaml index c0a952ff9..561d7f8ed 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_media_player.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_media_player.yaml @@ -244,13 +244,14 @@ card_media_player: return variables.ulm_card_media_player_enable_popup ? "fire-dom-event" : "more-info"; ]]] browser_mod: - command: "popup" - large: true - hide_header: true - card: - type: "custom:button-card" - template: "popup_media_player_infos" - entity: "[[[ return entity.entity_id ]]]" + service: "browser_mod.popup" + data: + large: true + hide_header: true + content: + type: "custom:button-card" + template: "popup_media_player_infos" + entity: "[[[ return entity.entity_id ]]]" tap_action: action: "call-service" service: "media_player.media_previous_track" @@ -283,13 +284,14 @@ card_media_player: return variables.ulm_card_media_player_enable_popup ? "fire-dom-event" : "more-info"; ]]] browser_mod: - command: "popup" - large: true - hide_header: true - card: - type: "custom:button-card" - template: "popup_media_player_infos" - entity: "[[[ return entity.entity_id; ]]]" + service: "browser_mod.popup" + data: + large: true + hide_header: true + content: + type: "custom:button-card" + template: "popup_media_player_infos" + entity: "[[[ return entity.entity_id; ]]]" tap_action: action: "call-service" service: "media_player.media_play_pause" @@ -328,13 +330,14 @@ card_media_player: return variables.ulm_card_media_player_enable_popup ? "fire-dom-event" : "more-info"; ]]] browser_mod: - command: "popup" - large: true - hide_header: true - card: - type: "custom:button-card" - template: "popup_media_player_infos" - entity: "[[[ return entity.entity_id; ]]]" + service: "browser_mod.popup" + data: + large: true + hide_header: true + content: + type: "custom:button-card" + template: "popup_media_player_infos" + entity: "[[[ return entity.entity_id; ]]]" tap_action: action: "call-service" service: "media_player.media_next_track" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_brightness.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_brightness.yaml index 189f35b60..58ae2ccc4 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_brightness.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_brightness.yaml @@ -284,25 +284,26 @@ popup_light_brightness: tap_action: action: "fire-dom-event" browser_mod: - command: "popup" - hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - card: - type: "custom:button-card" - template: "popup_light_color_temp" - entity: "[[[ return entity.entity_id; ]]]" + service: "browser_mod.popup" + data: + hide_header: true + style: + .: | + :host { + --mdc-theme-surface: var(--primary-background-color); + --secondary-background-color: var(--primary-background-color); + } + $: | + .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { + border-radius: 0px; + } + :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { + padding: 20px 24px; + } + content: + type: "custom:button-card" + template: "popup_light_color_temp" + entity: "[[[ return entity.entity_id; ]]]" item3: card: icon: "mdi:palette" @@ -323,25 +324,26 @@ popup_light_brightness: tap_action: action: "fire-dom-event" browser_mod: - command: "popup" - hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - card: - type: "custom:button-card" - template: "popup_light_color" - entity: "[[[ return entity.entity_id; ]]]" + service: "browser_mod.popup" + data: + hide_header: true + style: + .: | + :host { + --mdc-theme-surface: var(--primary-background-color); + --secondary-background-color: var(--primary-background-color); + } + $: | + .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { + border-radius: 0px; + } + :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { + padding: 20px 24px; + } + content: + type: "custom:button-card" + template: "popup_light_color" + entity: "[[[ return entity.entity_id; ]]]" footer: card: type: "custom:button-card" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color.yaml index e2faa4410..8d73b5c6a 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color.yaml @@ -50,25 +50,26 @@ popup_light_color: tap_action: action: "fire-dom-event" browser_mod: - command: "popup" - hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - card: - type: "custom:button-card" - template: "popup_light_brightness" - entity: "[[[ return entity.entity_id; ]]]" + service: "browser_mod.popup" + data: + hide_header: true + style: + .: | + :host { + --mdc-theme-surface: var(--primary-background-color); + --secondary-background-color: var(--primary-background-color); + } + $: | + .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { + border-radius: 0px; + } + :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { + padding: 20px 24px; + } + content: + type: "custom:button-card" + template: "popup_light_brightness" + entity: "[[[ return entity.entity_id; ]]]" item2: card: icon: "mdi:sun-thermometer-outline" @@ -79,25 +80,26 @@ popup_light_color: tap_action: action: "fire-dom-event" browser_mod: - command: "popup" - hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - card: - type: "custom:button-card" - template: "popup_light_color_temp" - entity: "[[[ return entity.entity_id; ]]]" + service: "browser_mod.popup" + data: + hide_header: true + style: + .: | + :host { + --mdc-theme-surface: var(--primary-background-color); + --secondary-background-color: var(--primary-background-color); + } + $: | + .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { + border-radius: 0px; + } + :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { + padding: 20px 24px; + } + content: + type: "custom:button-card" + template: "popup_light_color_temp" + entity: "[[[ return entity.entity_id; ]]]" item3: card: icon: "mdi:palette" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color_temp.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color_temp.yaml index f7d7e705b..ebcaea322 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color_temp.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color_temp.yaml @@ -50,25 +50,26 @@ popup_light_color_temp: tap_action: action: "fire-dom-event" browser_mod: - command: "popup" - hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - card: - type: "custom:button-card" - template: "popup_light_brightness" - entity: "[[[ return entity.entity_id; ]]]" + service: "browser_mod.popup" + data: + hide_header: true + style: + .: | + :host { + --mdc-theme-surface: var(--primary-background-color); + --secondary-background-color: var(--primary-background-color); + } + $: | + .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { + border-radius: 0px; + } + :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { + padding: 20px 24px; + } + content: + type: "custom:button-card" + template: "popup_light_brightness" + entity: "[[[ return entity.entity_id; ]]]" item2: card: icon: "mdi:sun-thermometer-outline" @@ -87,22 +88,23 @@ popup_light_color_temp: tap_action: action: "fire-dom-event" browser_mod: - command: "popup" - hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - card: - type: "custom:button-card" - template: "popup_light_color" - entity: "[[[ return entity.entity_id; ]]]" + service: "browser_mod.popup" + data: + hide_header: true + style: + .: | + :host { + --mdc-theme-surface: var(--primary-background-color); + --secondary-background-color: var(--primary-background-color); + } + $: | + .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { + border-radius: 0px; + } + :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { + padding: 20px 24px; + } + content: + type: "custom:button-card" + template: "popup_light_color" + entity: "[[[ return entity.entity_id; ]]]" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_volume.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_volume.yaml index 72d2b296c..d3941b4d5 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_volume.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_volume.yaml @@ -44,25 +44,26 @@ popup_media_player_volume: tap_action: action: "fire-dom-event" browser_mod: - command: "popup" - hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - card: - type: "custom:button-card" - template: "popup_media_player_infos" - entity: "[[[ return entity.entity_id; ]]]" + service: "browser_mod.popup" + data: + hide_header: true + style: + .: | + :host { + --mdc-theme-surface: var(--primary-background-color); + --secondary-background-color: var(--primary-background-color); + } + $: | + .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { + border-radius: 0px; + } + :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { + padding: 20px 24px; + } + content: + type: "custom:button-card" + template: "popup_media_player_infos" + entity: "[[[ return entity.entity_id; ]]]" item2: card: type: "custom:button-card" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_history.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_history.yaml index e2f547607..f1106a99b 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_history.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_history.yaml @@ -45,29 +45,30 @@ popup_power_outlet_history: tap_action: action: "fire-dom-event" browser_mod: - command: "popup" - hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - card: - type: "custom:button-card" - template: "popup_power_outlet_stats" - entity: "[[[ return entity.entity_id ]]]" - variables: - ulm_popup_power_outlet_sensor1: "[[[ return variables.ulm_popup_power_outlet_sensor1 ]]]" - ulm_popup_power_outlet_sensor2: "[[[ return variables.ulm_popup_power_outlet_sensor2 ]]]" - ulm_popup_power_outlet_graph_sensor: "[[[ return variables.ulm_popup_power_outlet_graph_sensor ]]]" + service: "browser_mod.popup" + data: + hide_header: true + style: + .: | + :host { + --mdc-theme-surface: var(--primary-background-color); + --secondary-background-color: var(--primary-background-color); + } + $: | + .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { + border-radius: 0px; + } + :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { + padding: 20px 24px; + } + content: + type: "custom:button-card" + template: "popup_power_outlet_stats" + entity: "[[[ return entity.entity_id ]]]" + variables: + ulm_popup_power_outlet_sensor1: "[[[ return variables.ulm_popup_power_outlet_sensor1 ]]]" + ulm_popup_power_outlet_sensor2: "[[[ return variables.ulm_popup_power_outlet_sensor2 ]]]" + ulm_popup_power_outlet_graph_sensor: "[[[ return variables.ulm_popup_power_outlet_graph_sensor ]]]" item2: card: icon: "mdi:history" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_stats.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_stats.yaml index b30180d93..321934fbb 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_stats.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_stats.yaml @@ -131,29 +131,30 @@ popup_power_outlet_stats: tap_action: action: "fire-dom-event" browser_mod: - command: "popup" - hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - card: - type: "custom:button-card" - template: "popup_power_outlet_history" - entity: "[[[ return entity.entity_id ]]]" - variables: - ulm_popup_power_outlet_sensor1: "[[[ return variables.ulm_popup_power_outlet_sensor1 ]]]" - ulm_popup_power_outlet_sensor2: "[[[ return variables.ulm_popup_power_outlet_sensor2 ]]]" - ulm_popup_power_outlet_graph_sensor: "[[[ return variables.ulm_popup_power_outlet_graph_sensor ]]]" + service: "browser_mod.popup" + data: + hide_header: true + style: + .: | + :host { + --mdc-theme-surface: var(--primary-background-color); + --secondary-background-color: var(--primary-background-color); + } + $: | + .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { + border-radius: 0px; + } + :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { + padding: 20px 24px; + } + content: + type: "custom:button-card" + template: "popup_power_outlet_history" + entity: "[[[ return entity.entity_id ]]]" + variables: + ulm_popup_power_outlet_sensor1: "[[[ return variables.ulm_popup_power_outlet_sensor1 ]]]" + ulm_popup_power_outlet_sensor2: "[[[ return variables.ulm_popup_power_outlet_sensor2 ]]]" + ulm_popup_power_outlet_graph_sensor: "[[[ return variables.ulm_popup_power_outlet_graph_sensor ]]]" footer: card: type: "custom:button-card" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml index fe2470867..e93714ac8 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml @@ -191,25 +191,26 @@ popup_weather_forecast: tap_action: action: "fire-dom-event" browser_mod: - command: "popup" - hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - card: - type: "custom:button-card" - template: "popup_weather_radar" - entity: "[[[ return entity.entity_id ]]]" + service: "browser_mod.popup" + data: + hide_header: true + style: + .: | + :host { + --mdc-theme-surface: var(--primary-background-color); + --secondary-background-color: var(--primary-background-color); + } + $: | + .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { + border-radius: 0px; + } + :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { + padding: 20px 24px; + } + content: + type: "custom:button-card" + template: "popup_weather_radar" + entity: "[[[ return entity.entity_id ]]]" footer: card: type: "custom:button-card" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_radar.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_radar.yaml index 4844809f7..a324af8d5 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_radar.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_radar.yaml @@ -44,25 +44,26 @@ popup_weather_radar: tap_action: action: "fire-dom-event" browser_mod: - command: "popup" - hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - card: - type: "custom:button-card" - template: "popup_weather_forecast" - entity: "[[[ return entity.entity_id; ]]]" + service: "browser_mod.popup" + data: + hide_header: true + style: + .: | + :host { + --mdc-theme-surface: var(--primary-background-color); + --secondary-background-color: var(--primary-background-color); + } + $: | + .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { + border-radius: 0px; + } + :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { + padding: 20px 24px; + } + content: + type: "custom:button-card" + template: "popup_weather_forecast" + entity: "[[[ return entity.entity_id; ]]]" item2: card: icon: "mdi:radar" From fb507b7229f0e39b8a7542357529359492557196 Mon Sep 17 00:00:00 2001 From: basbruss <68892092+basbruss@users.noreply.github.com> Date: Mon, 5 Sep 2022 09:55:10 +0200 Subject: [PATCH 10/21] update --- .../custom_card_imswel_person.yaml | 189 +++++++++--------- .../custom_card_schumijo_car.yaml | 141 ++++++------- .../popup_buttons/popup_button_back.yaml | 2 + .../popups/popup_media_player_infos.yaml | 39 ++-- 4 files changed, 189 insertions(+), 182 deletions(-) diff --git a/custom_cards/custom_card_imswel_person/custom_card_imswel_person.yaml b/custom_cards/custom_card_imswel_person/custom_card_imswel_person.yaml index 6120c1e03..c7a210937 100644 --- a/custom_cards/custom_card_imswel_person/custom_card_imswel_person.yaml +++ b/custom_cards/custom_card_imswel_person/custom_card_imswel_person.yaml @@ -111,104 +111,105 @@ custom_popup_imswel_person: tap_action: action: "fire-dom-event" browser_mod: - command: "popup" - title: "[[[ return states[variables.ulm_card_imswel_person_entity].attributes.friendly_name ]]]" - style: - $: > - [[[ - if (hass.themes.theme.includes("desktop")){ - var dialog = ` - .mdc-dialog__surface{ - border-radius: var(--border-radius) !important; + service: "browser_mod.popup" + data: + title: "[[[ return states[variables.ulm_card_imswel_person_entity].attributes.friendly_name ]]]" + style: + $: > + [[[ + if (hass.themes.theme.includes("desktop")){ + var dialog = ` + .mdc-dialog__surface{ + border-radius: var(--border-radius) !important; + } + `; + } else{ + var dialog = ""; + } + return ` + *{ + --secondary-background-color: none !important; } + ${dialog} `; - } else{ - var dialog = ""; - } - return ` - *{ - --secondary-background-color: none !important; - } - ${dialog} - `; - ]]] - hui-vertical-stack-card: - $: > - button-card { - align-self: center; - padding: 0.2em 0 2.3em 0; - } - hui-entities-card{ - padding: 0.8em 1.4em; - } - $hui-entities-card$: > - ha-card{ - box-shadow: none; - } - $hui-history-graph-card$: > - .content { - padding: 0 2.4em !important; - } - ha-card{ - box-shadow: none; - } - $hui-glance-card$: > - ha-card{ - box-shadow: none; - } - $hui-map-card: + ]]] + hui-vertical-stack-card: $: > - ha-icon-button { - color: rgba(var(--color-blue),1); + button-card { + align-self: center; + padding: 0.2em 0 2.3em 0; + } + hui-entities-card{ + padding: 0.8em 1.4em; + } + $hui-entities-card$: > + ha-card{ + box-shadow: none; + } + $hui-history-graph-card$: > + .content { + padding: 0 2.4em !important; } - $ha-map: + ha-card{ + box-shadow: none; + } + $hui-glance-card$: > + ha-card{ + box-shadow: none; + } + $hui-map-card: $: > - .leaflet-control-attribution { - display: none; - } - .leaflet-touch .leaflet-control-layers, .leaflet-touch .leaflet-bar { - border: 2px solid rgba(var(--color-blue),0.4) !important; + ha-icon-button { + color: rgba(var(--color-blue),1); } - .leaflet-bar a { - background-color: rgba(var(--color-blue),0.2) !important; - color: rgba(var(--color-blue),1) !important; - } - .leaflet-bar a:first-child { - border-bottom: 2px solid rgba(var(--color-blue),0.4) !important; - } - .leaflet-pane.leaflet-tile-pane { - filter: contrast(95%); - } - card: - type: "vertical-stack" - cards: - - type: "entities" - entities: - - entity: "[[[ return variables.ulm_card_imswel_person_entity; ]]]" - secondary_info: "last-changed" - - type: "history-graph" - entities: - - entity: "[[[ return variables.ulm_card_imswel_person_entity; ]]]" - - type: "glance" - show_state: false - entities: - - entity: "[[[ return variables.ulm_card_imswel_person_wifi_tracker; ]]]" - name: "WiFi" - icon: "mdi:wifi" - style: &state > - state-badge{ - color: {{ 'rgba(var(--color-blue),1)' if is_state(config.entity, 'home') }}; - filter: {{ 'opacity(100%)' if is_state(config.entity, 'home') else 'opacity(40%)'}}; + $ha-map: + $: > + .leaflet-control-attribution { + display: none; + } + .leaflet-touch .leaflet-control-layers, .leaflet-touch .leaflet-bar { + border: 2px solid rgba(var(--color-blue),0.4) !important; + } + .leaflet-bar a { + background-color: rgba(var(--color-blue),0.2) !important; + color: rgba(var(--color-blue),1) !important; + } + .leaflet-bar a:first-child { + border-bottom: 2px solid rgba(var(--color-blue),0.4) !important; + } + .leaflet-pane.leaflet-tile-pane { + filter: contrast(95%); } - - entity: "[[[ return variables.ulm_card_imswel_person_gps_tracker; ]]]" - name: "GPS" - icon: "mdi:map-marker" - style: *state - - type: "custom:button-card" - template: - - "find_my_phone_button" - entity: "[[[ return variables.ulm_card_imswel_person_findmy_script; ]]]" - - type: "map" - aspect_ratio: "12x10" - default_zoom: 16 - entities: "[[[ return [variables.ulm_card_imswel_person_gps_tracker]; ]]]" + content: + type: "vertical-stack" + cards: + - type: "entities" + entities: + - entity: "[[[ return variables.ulm_card_imswel_person_entity; ]]]" + secondary_info: "last-changed" + - type: "history-graph" + entities: + - entity: "[[[ return variables.ulm_card_imswel_person_entity; ]]]" + - type: "glance" + show_state: false + entities: + - entity: "[[[ return variables.ulm_card_imswel_person_wifi_tracker; ]]]" + name: "WiFi" + icon: "mdi:wifi" + style: &state > + state-badge{ + color: {{ 'rgba(var(--color-blue),1)' if is_state(config.entity, 'home') }}; + filter: {{ 'opacity(100%)' if is_state(config.entity, 'home') else 'opacity(40%)'}}; + } + - entity: "[[[ return variables.ulm_card_imswel_person_gps_tracker; ]]]" + name: "GPS" + icon: "mdi:map-marker" + style: *state + - type: "custom:button-card" + template: + - "find_my_phone_button" + entity: "[[[ return variables.ulm_card_imswel_person_findmy_script; ]]]" + - type: "map" + aspect_ratio: "12x10" + default_zoom: 16 + entities: "[[[ return [variables.ulm_card_imswel_person_gps_tracker]; ]]]" diff --git a/custom_cards/custom_card_schumijo_car/custom_card_schumijo_car.yaml b/custom_cards/custom_card_schumijo_car/custom_card_schumijo_car.yaml index a8b0f5592..e546e2431 100644 --- a/custom_cards/custom_card_schumijo_car/custom_card_schumijo_car.yaml +++ b/custom_cards/custom_card_schumijo_car/custom_card_schumijo_car.yaml @@ -107,79 +107,80 @@ ulm_custom_card_schumijo_ca_popup: tap_action: action: "fire-dom-event" browser_mod: - command: "popup" - title: "Map" - style: - $: > - [[[ - if (hass.themes.theme.includes("desktop")){ - var dialog = ` - .mdc-dialog__surface{ - border-radius: var(--border-radius) !important; + service: "browser_mod.popup" + data: + title: "Map" + style: + $: > + [[[ + if (hass.themes.theme.includes("desktop")){ + var dialog = ` + .mdc-dialog__surface{ + border-radius: var(--border-radius) !important; + } + `; + } else{ + var dialog = ""; + } + return ` + *{ + --secondary-background-color: none !important; } + ${dialog} `; - } else{ - var dialog = ""; - } - return ` - *{ - --secondary-background-color: none !important; - } - ${dialog} - `; - ]]] - hui-vertical-stack-card: - $: > - button-card { - align-self: center; - padding: 0.2em 0 2.3em 0; - } - hui-entities-card{ - padding: 0.8em 1.4em; - } - $hui-entities-card$: > - ha-card{ - box-shadow: none; - } - $hui-history-graph-card$: > - .content { - padding: 0 2.4em !important; - } - ha-card{ - box-shadow: none; - } - $hui-glance-card$: > - ha-card{ - box-shadow: none; - } - $hui-map-card: + ]]] + hui-vertical-stack-card: $: > - ha-icon-button { - color: rgba(var(--color-blue),1); + button-card { + align-self: center; + padding: 0.2em 0 2.3em 0; + } + hui-entities-card{ + padding: 0.8em 1.4em; + } + $hui-entities-card$: > + ha-card{ + box-shadow: none; } - $ha-map: + $hui-history-graph-card$: > + .content { + padding: 0 2.4em !important; + } + ha-card{ + box-shadow: none; + } + $hui-glance-card$: > + ha-card{ + box-shadow: none; + } + $hui-map-card: $: > - .leaflet-control-attribution { - display: none; - } - .leaflet-touch .leaflet-control-layers, .leaflet-touch .leaflet-bar { - border: 2px solid rgba(var(--color-blue),0.4) !important; + ha-icon-button { + color: rgba(var(--color-blue),1); } - .leaflet-bar a { - background-color: rgba(var(--color-blue),0.2) !important; - color: rgba(var(--color-blue),1) !important; - } - .leaflet-bar a:first-child { - border-bottom: 2px solid rgba(var(--color-blue),0.4) !important; - } - .leaflet-pane.leaflet-tile-pane { - filter: contrast(95%); - } - card: - type: "map" - aspect_ratio: "12:10" - default_zoom: 16 - entities: "[[[ return [variables.ulm_card_schumijo_car_tracker]; ]]]" + $ha-map: + $: > + .leaflet-control-attribution { + display: none; + } + .leaflet-touch .leaflet-control-layers, .leaflet-touch .leaflet-bar { + border: 2px solid rgba(var(--color-blue),0.4) !important; + } + .leaflet-bar a { + background-color: rgba(var(--color-blue),0.2) !important; + color: rgba(var(--color-blue),1) !important; + } + .leaflet-bar a:first-child { + border-bottom: 2px solid rgba(var(--color-blue),0.4) !important; + } + .leaflet-pane.leaflet-tile-pane { + filter: contrast(95%); + } + content: + type: "map" + aspect_ratio: "12:10" + default_zoom: 16 + entities: "[[[ return [variables.ulm_card_schumijo_car_tracker]; ]]]" custom_card_schumijo_car: template: @@ -225,7 +226,8 @@ custom_card_schumijo_car: [[[ return parseFloat(states[variables.ulm_card_schumijo_car_energy_level].state).toFixed(0); ]]] - name: "[[[ return states[variables.ulm_card_schumijo_car_energy_level].attributes.unit_of_measurement + ' ' + variables.ulm_custom_card_schumijo_car_energy_level\ + name: + "[[[ return states[variables.ulm_card_schumijo_car_energy_level].attributes.unit_of_measurement + ' ' + variables.ulm_custom_card_schumijo_car_energy_level\ \ ]]]" item2: card: @@ -236,5 +238,6 @@ custom_card_schumijo_car: [[[ return parseFloat(states[variables.ulm_card_schumijo_car_range].state).toFixed(0); ]]] - name: "[[[ return states[variables.ulm_card_schumijo_car_range].attributes.unit_of_measurement + ' ' + variables.ulm_custom_card_schumijo_car_range\ + name: + "[[[ return states[variables.ulm_card_schumijo_car_range].attributes.unit_of_measurement + ' ' + variables.ulm_custom_card_schumijo_car_range\ \ ]]]" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popup_buttons/popup_button_back.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popup_buttons/popup_button_back.yaml index d16278b1b..1bd2a53af 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popup_buttons/popup_button_back.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popup_buttons/popup_button_back.yaml @@ -17,3 +17,5 @@ popup_button_back: action: "fire-dom-event" browser_mod: service: "browser_mod.close_popup" + data: + browser_id: "THIS" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_infos.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_infos.yaml index 8d0a307c0..5c56f9c8e 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_infos.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_infos.yaml @@ -223,25 +223,26 @@ popup_media_player_infos: tap_action: action: "fire-dom-event" browser_mod: - command: "popup" - hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - card: - type: "custom:button-card" - template: "popup_media_player_volume" - entity: "[[[ return entity.entity_id; ]]]" + service: "browser_mod.popup" + data: + hide_header: true + style: + .: | + :host { + --mdc-theme-surface: var(--primary-background-color); + --secondary-background-color: var(--primary-background-color); + } + $: | + .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { + border-radius: 0px; + } + :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { + padding: 20px 24px; + } + content: + type: "custom:button-card" + template: "popup_media_player_volume" + entity: "[[[ return entity.entity_id; ]]]" footer: card: type: "custom:button-card" From 3eb42c01f24e99d38a18052c96dc78dff72620e6 Mon Sep 17 00:00:00 2001 From: basbruss <68892092+basbruss@users.noreply.github.com> Date: Mon, 5 Sep 2022 10:19:49 +0200 Subject: [PATCH 11/21] Rework back button --- .../popup_buttons/popup_button_back.yaml | 3 +-- .../popups/popup_media_player_volume.yaml | 20 +++++++++++++++++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popup_buttons/popup_button_back.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popup_buttons/popup_button_back.yaml index 1bd2a53af..84e58ab6f 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popup_buttons/popup_button_back.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popup_buttons/popup_button_back.yaml @@ -17,5 +17,4 @@ popup_button_back: action: "fire-dom-event" browser_mod: service: "browser_mod.close_popup" - data: - browser_id: "THIS" + data: {} diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_volume.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_volume.yaml index d3941b4d5..04946d72c 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_volume.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_volume.yaml @@ -27,6 +27,26 @@ popup_media_player_volume: display: none; } custom_fields: + footer: + card: + type: "custom:button-card" + template: "popup_list_items" + custom_fields: + item1: + card: + type: "custom:button-card" + template: "popup_button_back" + tap_action: + action: "fire-dom-event" + browser_mod: + service: "browser_mod.popup" + data: + large: true + hide_header: true + content: + type: "custom:button-card" + template: "popup_media_player_infos" + entity: "[[[ return entity.entity_id; ]]]" buttons: card: type: "custom:button-card" From d3c70177c3374a4465fe72809cecb69d3ebb9562 Mon Sep 17 00:00:00 2001 From: basbruss <68892092+basbruss@users.noreply.github.com> Date: Mon, 5 Sep 2022 11:27:24 +0200 Subject: [PATCH 12/21] Adapt for upcoming style name changes in browser_mod --- .../ulm_templates/actions/actions_card.yaml | 57 +++++--------- .../ulm_templates/actions/actions_icon.yaml | 78 +++++-------------- .../ulm_templates/actions/actions_name.yaml | 78 +++++-------------- .../popups/popup_light_brightness.yaml | 38 +++------ .../popups/popup_light_color.yaml | 38 +++------ .../popups/popup_light_color_temp.yaml | 38 +++------ .../popups/popup_media_player_infos.yaml | 19 ++--- .../popups/popup_media_player_volume.yaml | 19 ++--- .../popups/popup_power_outlet_history.yaml | 19 ++--- .../popups/popup_power_outlet_stats.yaml | 19 ++--- .../popups/popup_weather_forecast.yaml | 19 ++--- .../popups/popup_weather_radar.yaml | 19 ++--- 12 files changed, 126 insertions(+), 315 deletions(-) diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card.yaml index a90c8b2b9..f6e971785 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card.yaml @@ -62,19 +62,12 @@ ulm_actions_card: data: large: true hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } + style: | + :host { + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding: 20px 24px; + } content: type: "custom:button-card" template: > @@ -168,19 +161,12 @@ ulm_actions_card: data: large: true hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } + style: | + :host { + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding: 20px 24px; + } content: type: "custom:button-card" template: > @@ -274,19 +260,12 @@ ulm_actions_card: data: large: true hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } + style: | + :host { + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding: 20px 24px; + } content: type: "custom:button-card" template: > diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_icon.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_icon.yaml index cf226afcf..4c8d8ec45 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_icon.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_icon.yaml @@ -62,26 +62,12 @@ ulm_actions_icon: data: large: true hide_header: true - style: - $: | - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - @media (max-width: 450px), (max-height: 500px) { - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - } - .: | - @media (max-width: 450px), (max-height: 500px) { - ha-dialog { - --ha-card-border-radius: 0px; - } - } - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } + style: | + :host { + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding: 20px 24px; + } content: type: "custom:button-card" template: > @@ -185,26 +171,12 @@ ulm_actions_icon: data: large: true hide_header: true - style: - $: | - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - @media (max-width: 450px), (max-height: 500px) { - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - } - .: | - @media (max-width: 450px), (max-height: 500px) { - ha-dialog { - --ha-card-border-radius: 0px; - } - } - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } + style: | + :host { + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding: 20px 24px; + } content: type: "custom:button-card" template: > @@ -312,26 +284,12 @@ ulm_actions_icon: data: large: true hide_header: true - style: - $: | - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - @media (max-width: 450px), (max-height: 500px) { - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - } - .: | - @media (max-width: 450px), (max-height: 500px) { - ha-dialog { - --ha-card-border-radius: 0px; - } - } - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } + style: | + :host { + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding: 20px 24px; + } content: type: "custom:button-card" template: > diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_name.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_name.yaml index 9914c693e..53e3d58ae 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_name.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_name.yaml @@ -62,26 +62,12 @@ ulm_actions_name: data: large: true hide_header: true - style: - $: | - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - @media (max-width: 450px), (max-height: 500px) { - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - } - .: | - @media (max-width: 450px), (max-height: 500px) { - ha-dialog { - --ha-card-border-radius: 0px; - } - } - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } + style: | + :host { + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding: 20px 24px; + } content: type: "custom:button-card" template: > @@ -175,26 +161,12 @@ ulm_actions_name: data: large: true hide_header: true - style: - $: | - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - @media (max-width: 450px), (max-height: 500px) { - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - } - .: | - @media (max-width: 450px), (max-height: 500px) { - ha-dialog { - --ha-card-border-radius: 0px; - } - } - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } + style: | + :host { + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding: 20px 24px; + } content: type: "custom:button-card" template: > @@ -288,26 +260,12 @@ ulm_actions_name: data: large: true hide_header: true - style: - $: | - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - @media (max-width: 450px), (max-height: 500px) { - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - } - .: | - @media (max-width: 450px), (max-height: 500px) { - ha-dialog { - --ha-card-border-radius: 0px; - } - } - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } + style: | + :host { + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding: 20px 24px; + } content: type: "custom:button-card" template: > diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_brightness.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_brightness.yaml index 58ae2ccc4..f08c8e379 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_brightness.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_brightness.yaml @@ -287,19 +287,12 @@ popup_light_brightness: service: "browser_mod.popup" data: hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } + style: | + :host { + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding: 20px 24px; + } content: type: "custom:button-card" template: "popup_light_color_temp" @@ -327,19 +320,12 @@ popup_light_brightness: service: "browser_mod.popup" data: hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } + style: | + :host { + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding: 20px 24px; + } content: type: "custom:button-card" template: "popup_light_color" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color.yaml index 8d73b5c6a..24c3ce7cf 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color.yaml @@ -53,19 +53,12 @@ popup_light_color: service: "browser_mod.popup" data: hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } + style: | + :host { + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding: 20px 24px; + } content: type: "custom:button-card" template: "popup_light_brightness" @@ -83,19 +76,12 @@ popup_light_color: service: "browser_mod.popup" data: hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } + style: | + :host { + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding: 20px 24px; + } content: type: "custom:button-card" template: "popup_light_color_temp" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color_temp.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color_temp.yaml index ebcaea322..7e177dda5 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color_temp.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color_temp.yaml @@ -53,19 +53,12 @@ popup_light_color_temp: service: "browser_mod.popup" data: hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } + style: | + :host { + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding: 20px 24px; + } content: type: "custom:button-card" template: "popup_light_brightness" @@ -91,19 +84,12 @@ popup_light_color_temp: service: "browser_mod.popup" data: hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } + style: | + :host { + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding: 20px 24px; + } content: type: "custom:button-card" template: "popup_light_color" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_infos.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_infos.yaml index 5c56f9c8e..c622b166b 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_infos.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_infos.yaml @@ -226,19 +226,12 @@ popup_media_player_infos: service: "browser_mod.popup" data: hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } + style: | + :host { + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding: 20px 24px; + } content: type: "custom:button-card" template: "popup_media_player_volume" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_volume.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_volume.yaml index 04946d72c..0963ebd97 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_volume.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_volume.yaml @@ -67,19 +67,12 @@ popup_media_player_volume: service: "browser_mod.popup" data: hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } + style: | + :host { + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding: 20px 24px; + } content: type: "custom:button-card" template: "popup_media_player_infos" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_history.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_history.yaml index f1106a99b..e90c4a4a4 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_history.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_history.yaml @@ -48,19 +48,12 @@ popup_power_outlet_history: service: "browser_mod.popup" data: hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } + style: | + :host { + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding: 20px 24px; + } content: type: "custom:button-card" template: "popup_power_outlet_stats" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_stats.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_stats.yaml index 321934fbb..d60059e9e 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_stats.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_stats.yaml @@ -134,19 +134,12 @@ popup_power_outlet_stats: service: "browser_mod.popup" data: hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } + style: | + :host { + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding: 20px 24px; + } content: type: "custom:button-card" template: "popup_power_outlet_history" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml index e93714ac8..09ef01758 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml @@ -194,19 +194,12 @@ popup_weather_forecast: service: "browser_mod.popup" data: hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } + style: | + :host { + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding: 20px 24px; + } content: type: "custom:button-card" template: "popup_weather_radar" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_radar.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_radar.yaml index a324af8d5..1e70b5c7e 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_radar.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_radar.yaml @@ -47,19 +47,12 @@ popup_weather_radar: service: "browser_mod.popup" data: hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } + style: | + :host { + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding: 20px 24px; + } content: type: "custom:button-card" template: "popup_weather_forecast" From 1b9887695460ccad7aee5924b1e9f6973346c678 Mon Sep 17 00:00:00 2001 From: basbruss <68892092+basbruss@users.noreply.github.com> Date: Mon, 5 Sep 2022 12:48:13 +0200 Subject: [PATCH 13/21] Rework to make preset mode compatible Use 'ulm_card_thermostat_preset_mode: true` to switch to preset mode --- .../card_templates/cards/card_thermostat.yaml | 7 +- .../popups/popup_thermostat.yaml | 2 - .../popups/popup_thermostat_temperature.yaml | 92 ++++++++++--------- 3 files changed, 52 insertions(+), 49 deletions(-) diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_thermostat.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_thermostat.yaml index a9e55191e..f1f79689b 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_thermostat.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_thermostat.yaml @@ -16,6 +16,7 @@ card_thermostat: ulm_card_thermostat_enable_popup: false ulm_card_thermostat_fan_entity: null ulm_card_thermostat_minimum_temp_spread: 1 + ulm_card_thermostat_preset_mode: false show_icon: false show_name: false show_label: false @@ -153,7 +154,8 @@ card_thermostat: if(variables.ulm_card_thermostat_enable_popup) { vars.ulm_custom_popup = { - 'template': 'popup_thermostat_temperature' + 'template': 'popup_thermostat_temperature', + 'popup_variables': {'ulm_card_thermostat_preset_mode': variables.ulm_card_thermostat_preset_mode } }; } return vars; @@ -190,7 +192,8 @@ card_thermostat: if(variables.ulm_card_thermostat_enable_popup) { vars.ulm_custom_popup = { - 'template': 'popup_thermostat_temperature' + 'template': 'popup_thermostat_temperature', + 'popup_variables': {'ulm_card_thermostat_preset_mode': variables.ulm_card_thermostat_preset_mode } }; } return vars; diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat.yaml index 381fdc639..9735668a2 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat.yaml @@ -10,5 +10,3 @@ popup_thermostat: type: "custom:button-card" template: "popup_thermostat_temperature" entity: "[[[ return entity.entity_id ]]]" - variables: - ulm_popup_thermostat_preset_mode: "[[[ return variables.ulm_popup_thermostat_preset_mode; ]]]" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat_temperature.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat_temperature.yaml index 5f41a6057..9a1a81cc2 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat_temperature.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_thermostat_temperature.yaml @@ -63,31 +63,14 @@ popup_thermostat_temperature: buttons: card: type: "custom:button-card" + variables: + ulm_card_thermostat_preset_mode: "[[[ return variables.ulm_card_thermostat_preset_mode; ]]]" styles: grid: - grid-template-areas: > [[[ var areas = []; - if !(variables.ulm_popup_thermostat_preset_mode){ - if (entity.attributes.hvac_modes.includes("auto")) { - areas.push("auto"); - } - if (entity.attributes.hvac_modes.includes("heat")) { - areas.push("heat"); - } - if (entity.attributes.hvac_modes.includes("cool")) { - areas.push("cool"); - } - if (entity.attributes.hvac_modes.includes("dry")) { - areas.push("dry"); - } - if (entity.attributes.hvac_modes.includes("fan_only")) { - areas.push("fan_only"); - } - if (entity.attributes.hvac_modes.includes("heat_cool")) { - areas.push("heat_cool"); - } - } else { + if (variables.ulm_card_thermostat_preset_mode){ if (entity.attributes.preset_modes.includes("none")) { areas.push("none"); } @@ -106,48 +89,67 @@ popup_thermostat_temperature: if (entity.attributes.preset_modes.includes("activity")) { areas.push("activity"); } + } else { + if (entity.attributes.hvac_modes.includes("auto")) { + areas.push("auto"); + } + if (entity.attributes.hvac_modes.includes("heat")) { + areas.push("heat"); + } + if (entity.attributes.hvac_modes.includes("cool")) { + areas.push("cool"); + } + if (entity.attributes.hvac_modes.includes("dry")) { + areas.push("dry"); + } + if (entity.attributes.hvac_modes.includes("fan_only")) { + areas.push("fan_only"); + } + if (entity.attributes.hvac_modes.includes("heat_cool")) { + areas.push("heat_cool"); + } } return "\"" + areas.join(" ") + "\""; ]]] - grid-template-columns: > [[[ var columns = []; - if !(variables.ulm_popup_thermostat_preset_mode){ - if (entity.attributes.hvac_modes.includes("auto")) { + if (variables.ulm_card_thermostat_preset_mode){ + if (entity.attributes.preset_modes.includes("none")) { columns.push("1fr"); } - if (entity.attributes.hvac_modes.includes("heat")) { + if (entity.attributes.preset_modes.includes("away")) { columns.push("1fr"); } - if (entity.attributes.hvac_modes.includes("cool")) { + if (entity.attributes.preset_modes.includes("comfort")) { columns.push("1fr"); } - if (entity.attributes.hvac_modes.includes("dry")) { + if (entity.attributes.preset_modes.includes("home")) { columns.push("1fr"); } - if (entity.attributes.hvac_modes.includes("fan_only")) { + if (entity.attributes.preset_modes.includes("sleep")) { columns.push("1fr"); } - if (entity.attributes.hvac_modes.includes("heat_cool")) { + if (entity.attributes.preset_modes.includes("activity")) { columns.push("1fr"); } } else { - if (entity.attributes.preset_modes.includes("none")) { + if (entity.attributes.hvac_modes.includes("auto")) { columns.push("1fr"); } - if (entity.attributes.preset_modes.includes("away")) { + if (entity.attributes.hvac_modes.includes("heat")) { columns.push("1fr"); } - if (entity.attributes.preset_modes.includes("comfort")) { + if (entity.attributes.hvac_modes.includes("cool")) { columns.push("1fr"); } - if (entity.attributes.preset_modes.includes("home")) { + if (entity.attributes.hvac_modes.includes("dry")) { columns.push("1fr"); } - if (entity.attributes.preset_modes.includes("sleep")) { + if (entity.attributes.hvac_modes.includes("fan_only")) { columns.push("1fr"); } - if (entity.attributes.preset_modes.includes("activity")) { + if (entity.attributes.hvac_modes.includes("heat_cool")) { columns.push("1fr"); } } @@ -164,7 +166,7 @@ popup_thermostat_temperature: auto: - display: > [[[ - if (entity.attributes.hvac_modes.includes("auto")) { + if (entity.attributes.hvac_modes.includes("auto") && !variables.ulm_card_thermostat_preset_mode) { return "block"; } else { return "none"; @@ -173,7 +175,7 @@ popup_thermostat_temperature: heat: - display: > [[[ - if (entity.attributes.hvac_modes.includes("heat")) { + if (entity.attributes.hvac_modes.includes("heat") && !variables.ulm_card_thermostat_preset_mode) { return "block"; } else { return "none"; @@ -182,7 +184,7 @@ popup_thermostat_temperature: cool: - display: > [[[ - if (entity.attributes.hvac_modes.includes("cool")) { + if (entity.attributes.hvac_modes.includes("cool") && !variables.ulm_card_thermostat_preset_mode) { return "block"; } else { return "none"; @@ -191,7 +193,7 @@ popup_thermostat_temperature: dry: - display: > [[[ - if (entity.attributes.hvac_modes.includes("dry")) { + if (entity.attributes.hvac_modes.includes("dry") && !variables.ulm_card_thermostat_preset_mode) { return "block"; } else { return "none"; @@ -200,7 +202,7 @@ popup_thermostat_temperature: fan_only: - display: > [[[ - if (entity.attributes.hvac_modes.includes("fan_only")) { + if (entity.attributes.hvac_modes.includes("fan_only") && !variables.ulm_card_thermostat_preset_mode) { return "block"; } else { return "none"; @@ -209,7 +211,7 @@ popup_thermostat_temperature: heat_cool: - display: > [[[ - if (entity.attributes.hvac_modes.includes("heat_cool")) { + if (entity.attributes.hvac_modes.includes("heat_cool") && !variables.ulm_card_thermostat_preset_mode) { return "block"; } else { return "none"; @@ -218,7 +220,7 @@ popup_thermostat_temperature: none: - display: > [[[ - if (entity.attributes.preset_modes.includes("none")) { + if (entity.attributes.preset_modes.includes("none") && variables.ulm_card_thermostat_preset_mode) { return "block"; } else { return "none"; @@ -227,7 +229,7 @@ popup_thermostat_temperature: away: - display: > [[[ - if (entity.attributes.preset_modes.includes("away")) { + if (entity.attributes.preset_modes.includes("away") && variables.ulm_card_thermostat_preset_mode) { return "block"; } else { return "none"; @@ -236,7 +238,7 @@ popup_thermostat_temperature: comfort: - display: > [[[ - if (entity.attributes.preset_modes.includes("comfort")) { + if (entity.attributes.preset_modes.includes("comfort") && variables.ulm_card_thermostat_preset_mode) { return "block"; } else { return "none"; @@ -245,7 +247,7 @@ popup_thermostat_temperature: home: - display: > [[[ - if (entity.attributes.preset_modes.includes("home")) { + if (entity.attributes.preset_modes.includes("home") && variables.ulm_card_thermostat_preset_mode) { return "block"; } else { return "none"; @@ -254,7 +256,7 @@ popup_thermostat_temperature: sleep: - display: > [[[ - if (entity.attributes.preset_modes.includes("sleep")) { + if (entity.attributes.preset_modes.includes("sleep") && variables.ulm_card_thermostat_preset_mode) { return "block"; } else { return "none"; @@ -263,7 +265,7 @@ popup_thermostat_temperature: activity: - display: > [[[ - if (entity.attributes.preset_modes.includes("activity")) { + if (entity.attributes.preset_modes.includes("activity") && variables.ulm_card_thermostat_preset_mode) { return "block"; } else { return "none"; From 18e403e021e72cc806498b5b78c52c93e58b3b80 Mon Sep 17 00:00:00 2001 From: basbruss <68892092+basbruss@users.noreply.github.com> Date: Mon, 5 Sep 2022 14:07:44 +0200 Subject: [PATCH 14/21] Update power outlet popup --- .../card_templates/cards/card_battery.yaml | 32 ++++++++++++++++++ .../cards/card_binary_sensor.yaml | 32 ++++++++++++++++++ .../cards/card_binary_sensor_alert.yaml | 32 ++++++++++++++++++ .../card_templates/cards/card_generic.yaml | 32 ++++++++++++++++++ .../cards/card_generic_swap.yaml | 32 ++++++++++++++++++ .../cards/card_input_boolean.yaml | 33 ++++++++++++++++++- .../cards/card_power_outlet.yaml | 32 ++++++++++++++++++ docs/usage/popups/popup_power_outlet.md | 14 +++----- 8 files changed, 229 insertions(+), 10 deletions(-) diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_battery.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_battery.yaml index a4e1ba541..e4dc089f9 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_battery.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_battery.yaml @@ -24,6 +24,22 @@ card_battery: card: type: "custom:button-card" entity: "[[[ return entity.entity_id ]]]" + variables: > + [[[ + let vars = variables; + + if(variables.ulm_outlet_power_enable_popup) { + vars.ulm_custom_popup = { + 'template': 'popup_power_outlet_stats', + 'popup_variables': { + 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, + 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, + 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor + } + }; + } + return vars; + ]]] icon: | [[[ // Get battery level @@ -96,6 +112,22 @@ card_battery: type: "custom:button-card" entity: "[[[ return entity.entity_id ]]]" name: "[[[ return variables.ulm_card_battery_name ]]]" + variables: > + [[[ + let vars = variables; + + if(variables.ulm_outlet_power_enable_popup) { + vars.ulm_custom_popup = { + 'template': 'popup_power_outlet_stats', + 'popup_variables': { + 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, + 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, + 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor + } + }; + } + return vars; + ]]] label: | [[[ const battery_level = variables.ulm_card_battery_attribute !== null diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_binary_sensor.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_binary_sensor.yaml index b6501a4db..0da501151 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_binary_sensor.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_binary_sensor.yaml @@ -24,6 +24,22 @@ card_binary_sensor: - "blue" entity: "[[[ return entity.entity_id ]]]" icon: "[[[ return variables.ulm_card_binary_sensor_icon; ]]]" + variables: > + [[[ + let vars = variables; + + if(variables.ulm_outlet_power_enable_popup) { + vars.ulm_custom_popup = { + 'template': 'popup_power_outlet_stats', + 'popup_variables': { + 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, + 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, + 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor + } + }; + } + return vars; + ]]] item2: card: type: "custom:button-card" @@ -33,3 +49,19 @@ card_binary_sensor: name: "[[[ return variables.ulm_card_binary_sensor_name; ]]]" label: "[[[ return variables.ulm_translation_state;]]]" show_last_changed: "[[[ return variables.ulm_show_last_changed; ]]]" + variables: > + [[[ + let vars = variables; + + if(variables.ulm_outlet_power_enable_popup) { + vars.ulm_custom_popup = { + 'template': 'popup_power_outlet_stats', + 'popup_variables': { + 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, + 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, + 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor + } + }; + } + return vars; + ]]] diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_binary_sensor_alert.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_binary_sensor_alert.yaml index 2ca7fd9af..12510c1e4 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_binary_sensor_alert.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_binary_sensor_alert.yaml @@ -24,6 +24,22 @@ card_binary_sensor_alert: - "blue" entity: "[[[ return entity.entity_id ]]]" icon: "[[[ return variables.ulm_card_binary_sensor_alert_icon; ]]]" + variables: > + [[[ + let vars = variables; + + if(variables.ulm_outlet_power_enable_popup) { + vars.ulm_custom_popup = { + 'template': 'popup_power_outlet_stats', + 'popup_variables': { + 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, + 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, + 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor + } + }; + } + return vars; + ]]] item2: card: type: "custom:button-card" @@ -33,3 +49,19 @@ card_binary_sensor_alert: name: "[[[ return variables.ulm_card_binary_sensor_alert_name; ]]]" label: "[[[ return variables.ulm_translation_state;]]]" show_last_changed: "[[[ return variables.ulm_show_last_changed; ]]]" + variables: > + [[[ + let vars = variables; + + if(variables.ulm_outlet_power_enable_popup) { + vars.ulm_custom_popup = { + 'template': 'popup_power_outlet_stats', + 'popup_variables': { + 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, + 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, + 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor + } + }; + } + return vars; + ]]] diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_generic.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_generic.yaml index bc239d3a3..93926a40c 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_generic.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_generic.yaml @@ -17,6 +17,22 @@ card_generic: type: "custom:button-card" entity: "[[[ return entity.entity_id ]]]" icon: "[[[ return variables.ulm_card_generic_icon; ]]]" + variables: > + [[[ + let vars = variables; + + if(variables.ulm_outlet_power_enable_popup) { + vars.ulm_custom_popup = { + 'template': 'popup_power_outlet_stats', + 'popup_variables': { + 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, + 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, + 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor + } + }; + } + return vars; + ]]] styles: icon: - color: "rgba(var(--color-theme),0.9)" @@ -26,3 +42,19 @@ card_generic: entity: "[[[ return entity.entity_id ]]]" name: "[[[ return variables.ulm_translation_state_unit ]]]" label: "[[[ return variables.ulm_card_generic_name ]]]" + variables: > + [[[ + let vars = variables; + + if(variables.ulm_outlet_power_enable_popup) { + vars.ulm_custom_popup = { + 'template': 'popup_power_outlet_stats', + 'popup_variables': { + 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, + 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, + 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor + } + }; + } + return vars; + ]]] diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_generic_swap.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_generic_swap.yaml index 0b75b093c..a4851389c 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_generic_swap.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_generic_swap.yaml @@ -20,9 +20,41 @@ card_generic_swap: styles: icon: - color: "rgba(var(--color-theme),0.9)" + variables: > + [[[ + let vars = variables; + + if(variables.ulm_outlet_power_enable_popup) { + vars.ulm_custom_popup = { + 'template': 'popup_power_outlet_stats', + 'popup_variables': { + 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, + 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, + 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor + } + }; + } + return vars; + ]]] item2: card: type: "custom:button-card" entity: "[[[ return entity.entity_id ]]]" label: "[[[ return variables.ulm_translation_state_unit ]]]" name: "[[[ return variables.ulm_card_generic_swap_name ]]]" + variables: > + [[[ + let vars = variables; + + if(variables.ulm_outlet_power_enable_popup) { + vars.ulm_custom_popup = { + 'template': 'popup_power_outlet_stats', + 'popup_variables': { + 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, + 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, + 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor + } + }; + } + return vars; + ]]] diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_input_boolean.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_input_boolean.yaml index cfaef7581..629449c5d 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_input_boolean.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_input_boolean.yaml @@ -20,9 +20,24 @@ card_input_boolean: type: "custom:button-card" template: - "blue" - entity: "[[[ return entity.entity_id ]]]" icon: "[[[ return variables.ulm_card_input_boolean_icon; ]]]" + variables: > + [[[ + let vars = variables; + + if(variables.ulm_outlet_power_enable_popup) { + vars.ulm_custom_popup = { + 'template': 'popup_power_outlet_stats', + 'popup_variables': { + 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, + 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, + 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor + } + }; + } + return vars; + ]]] item2: card: type: "custom:button-card" @@ -31,3 +46,19 @@ card_input_boolean: entity: "[[[ return entity.entity_id ]]]" name: "[[[ return variables.ulm_card_input_boolean_name; ]]]" label: "[[[ return variables.ulm_translation_state ]]]" + variables: > + [[[ + let vars = variables; + + if(variables.ulm_outlet_power_enable_popup) { + vars.ulm_custom_popup = { + 'template': 'popup_power_outlet_stats', + 'popup_variables': { + 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, + 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, + 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor + } + }; + } + return vars; + ]]] diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_power_outlet.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_power_outlet.yaml index 70be47682..ffad87648 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_power_outlet.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_power_outlet.yaml @@ -24,6 +24,22 @@ card_power_outlet: - "yellow" entity: "[[[ return entity.entity_id ]]]" icon: "[[[ return variables.ulm_card_power_outlet_icon ]]]" + variables: > + [[[ + let vars = variables; + + if(variables.ulm_outlet_power_enable_popup) { + vars.ulm_custom_popup = { + 'template': 'popup_power_outlet_stats', + 'popup_variables': { + 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, + 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, + 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor + } + }; + } + return vars; + ]]] item2: card: type: "custom:button-card" @@ -39,3 +55,19 @@ card_power_outlet: return variables.ulm_translation_state; } ]]] + variables: > + [[[ + let vars = variables; + + if(variables.ulm_outlet_power_enable_popup) { + vars.ulm_custom_popup = { + 'template': 'popup_power_outlet_stats', + 'popup_variables': { + 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, + 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, + 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor + } + }; + } + return vars; + ]]] diff --git a/docs/usage/popups/popup_power_outlet.md b/docs/usage/popups/popup_power_outlet.md index 3fdce0cb0..9e9aeeca9 100644 --- a/docs/usage/popups/popup_power_outlet.md +++ b/docs/usage/popups/popup_power_outlet.md @@ -16,12 +16,7 @@ hide: ##### Card compatibility -This popup is displayed using ``hold_action`` and it is compatible with the following cards/chips : - -!!! Warning "Warning" - - The popup is not compatible with the custom_actions! - The hold_action only works on the outer layer! +This popup is displayed using ``custom_actions`` and it is compatible with the following cards/chips : - card_generic - card_generic_swap @@ -62,7 +57,9 @@ This popup is displayed using ``hold_action`` and it is compatible with the foll ##### How to use -To enable this popup, you need to add the ``popup_power_outlet`` template on your card. And also the previously explained variables. +!!! warning "Breaking Change from version `V1.1.2`" + This popup can now be triggered with the custom action "popup". + The popup template can be deleted and use instead the variable `ulm_outlet_power_enable_popup: true` to enable the use of the popup. For example : @@ -70,14 +67,13 @@ For example : - type: "custom:button-card" template: - card_power_outlet - - popup_power_outlet variables: ulm_card_power_outlet_consumption_sensor: sensor.metered_wall_plug_switch_power_3 ulm_popup_power_outlet_sensor1: sensor.metered_wall_plug_switch_power_3 ulm_popup_power_outlet_sensor2: sensor.metered_wall_plug_switch_electric_consumed_kwh_2 ulm_popup_power_outlet_graph_sensor: sensor.metered_wall_plug_switch_power_3 + ulm_outlet_power_enable_popup: true entity: switch.metered_wall_plug_switch_2 - name: Prise téléphone ``` ## Credits From 50671cfd03d0d4772a0602f95db66246547b5f5b Mon Sep 17 00:00:00 2001 From: basbruss <68892092+basbruss@users.noreply.github.com> Date: Mon, 5 Sep 2022 14:16:57 +0200 Subject: [PATCH 15/21] Update docs --- docs/usage/popups/popup_thermostat.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/usage/popups/popup_thermostat.md b/docs/usage/popups/popup_thermostat.md index 72b8263d8..f7a2dec4e 100644 --- a/docs/usage/popups/popup_thermostat.md +++ b/docs/usage/popups/popup_thermostat.md @@ -15,6 +15,23 @@ This popup is displayed using ``hold_action`` and it is compatible with the foll - card_thermostat +##### Variables + + + + + + + + + + + + + + +
VariableExampleRequiredExplanation
ulm_card_thermostat_preset_modetruenoSwitch to Preset Mode
+ ##### How to use To enable this popup, add the variable ``ulm_card_thermostat_enable_popup`` and set to ``true``. @@ -30,6 +47,7 @@ For example : entity: climate.thermostat variables: ulm_card_thermostat_enable_popup: true + ulm_card_thermostat_preset_mode: true ``` ## Credits From 52d56099e2dc6f6351e751f384466a8a45c19fc8 Mon Sep 17 00:00:00 2001 From: basbruss <68892092+basbruss@users.noreply.github.com> Date: Tue, 6 Sep 2022 08:13:45 +0200 Subject: [PATCH 16/21] identation --- .../card_templates/cards/card_battery.yaml | 12 ++++++------ .../card_templates/cards/card_binary_sensor.yaml | 12 ++++++------ .../cards/card_binary_sensor_alert.yaml | 12 ++++++------ .../card_templates/cards/card_generic.yaml | 12 ++++++------ .../card_templates/cards/card_generic_swap.yaml | 12 ++++++------ .../card_templates/cards/card_input_boolean.yaml | 12 ++++++------ .../card_templates/cards/card_power_outlet.yaml | 16 ++++++---------- 7 files changed, 42 insertions(+), 46 deletions(-) diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_battery.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_battery.yaml index e4dc089f9..df1f61aad 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_battery.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_battery.yaml @@ -32,9 +32,9 @@ card_battery: vars.ulm_custom_popup = { 'template': 'popup_power_outlet_stats', 'popup_variables': { - 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, - 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, - 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor + 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, + 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, + 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor } }; } @@ -120,9 +120,9 @@ card_battery: vars.ulm_custom_popup = { 'template': 'popup_power_outlet_stats', 'popup_variables': { - 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, - 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, - 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor + 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, + 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, + 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor } }; } diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_binary_sensor.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_binary_sensor.yaml index 0da501151..ed8f0dc4e 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_binary_sensor.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_binary_sensor.yaml @@ -32,9 +32,9 @@ card_binary_sensor: vars.ulm_custom_popup = { 'template': 'popup_power_outlet_stats', 'popup_variables': { - 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, - 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, - 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor + 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, + 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, + 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor } }; } @@ -57,9 +57,9 @@ card_binary_sensor: vars.ulm_custom_popup = { 'template': 'popup_power_outlet_stats', 'popup_variables': { - 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, - 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, - 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor + 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, + 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, + 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor } }; } diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_binary_sensor_alert.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_binary_sensor_alert.yaml index 12510c1e4..b70f63c10 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_binary_sensor_alert.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_binary_sensor_alert.yaml @@ -32,9 +32,9 @@ card_binary_sensor_alert: vars.ulm_custom_popup = { 'template': 'popup_power_outlet_stats', 'popup_variables': { - 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, - 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, - 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor + 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, + 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, + 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor } }; } @@ -57,9 +57,9 @@ card_binary_sensor_alert: vars.ulm_custom_popup = { 'template': 'popup_power_outlet_stats', 'popup_variables': { - 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, - 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, - 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor + 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, + 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, + 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor } }; } diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_generic.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_generic.yaml index 93926a40c..e8c9c1626 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_generic.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_generic.yaml @@ -25,9 +25,9 @@ card_generic: vars.ulm_custom_popup = { 'template': 'popup_power_outlet_stats', 'popup_variables': { - 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, - 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, - 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor + 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, + 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, + 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor } }; } @@ -50,9 +50,9 @@ card_generic: vars.ulm_custom_popup = { 'template': 'popup_power_outlet_stats', 'popup_variables': { - 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, - 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, - 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor + 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, + 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, + 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor } }; } diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_generic_swap.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_generic_swap.yaml index a4851389c..ec7e4511a 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_generic_swap.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_generic_swap.yaml @@ -28,9 +28,9 @@ card_generic_swap: vars.ulm_custom_popup = { 'template': 'popup_power_outlet_stats', 'popup_variables': { - 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, - 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, - 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor + 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, + 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, + 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor } }; } @@ -50,9 +50,9 @@ card_generic_swap: vars.ulm_custom_popup = { 'template': 'popup_power_outlet_stats', 'popup_variables': { - 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, - 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, - 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor + 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, + 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, + 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor } }; } diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_input_boolean.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_input_boolean.yaml index 629449c5d..703ec4282 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_input_boolean.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_input_boolean.yaml @@ -30,9 +30,9 @@ card_input_boolean: vars.ulm_custom_popup = { 'template': 'popup_power_outlet_stats', 'popup_variables': { - 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, - 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, - 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor + 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, + 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, + 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor } }; } @@ -54,9 +54,9 @@ card_input_boolean: vars.ulm_custom_popup = { 'template': 'popup_power_outlet_stats', 'popup_variables': { - 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, - 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, - 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor + 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, + 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, + 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor } }; } diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_power_outlet.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_power_outlet.yaml index ffad87648..8d213d179 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_power_outlet.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_power_outlet.yaml @@ -31,11 +31,9 @@ card_power_outlet: if(variables.ulm_outlet_power_enable_popup) { vars.ulm_custom_popup = { 'template': 'popup_power_outlet_stats', - 'popup_variables': { - 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, - 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, - 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor - } + 'popup_variables': {'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, + 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, + 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor} }; } return vars; @@ -62,11 +60,9 @@ card_power_outlet: if(variables.ulm_outlet_power_enable_popup) { vars.ulm_custom_popup = { 'template': 'popup_power_outlet_stats', - 'popup_variables': { - 'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, - 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, - 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor - } + 'popup_variables': {'ulm_popup_power_outlet_sensor1': variables.ulm_popup_power_outlet_sensor1, + 'ulm_popup_power_outlet_sensor2': variables.ulm_popup_power_outlet_sensor2, + 'ulm_popup_power_outlet_graph_sensor': variables.ulm_popup_power_outlet_graph_sensor} }; } return vars; From 723c9aae7c04d942615ab04ac7447ee87d87b337 Mon Sep 17 00:00:00 2001 From: basbruss <68892092+basbruss@users.noreply.github.com> Date: Tue, 6 Sep 2022 08:52:41 +0200 Subject: [PATCH 17/21] Fix overflow --- .../popup_templates/popup_buttons/popup_button.yaml | 2 ++ .../popup_templates/popups/popup_light_brightness.yaml | 1 + 2 files changed, 3 insertions(+) diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popup_buttons/popup_button.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popup_buttons/popup_button.yaml index e0638b80d..3e7759903 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popup_buttons/popup_button.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popup_buttons/popup_button.yaml @@ -13,6 +13,7 @@ popup_button: - box-shadow: "none" - border-radius: "none" - padding: "12px" + - overflow: "visible" icon: - color: "var(--primary-color)" img_cell: @@ -27,3 +28,4 @@ popup_button: - font-weight: "bold" - font-size: "14px" - margin-top: "12px" + - overflow: "visible" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_brightness.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_brightness.yaml index f08c8e379..6cf6ae398 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_brightness.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_brightness.yaml @@ -219,6 +219,7 @@ popup_light_brightness: styles: card: - background: "none" + - overflow: "visible" grid: - grid-template-areas: > [[[ From 2516687884ed08669e276b56e5239952b1fb8442 Mon Sep 17 00:00:00 2001 From: basbruss <68892092+basbruss@users.noreply.github.com> Date: Tue, 6 Sep 2022 09:16:10 +0200 Subject: [PATCH 18/21] Revert "Adapt for upcoming style name changes in browser_mod" This reverts commit d3c70177c3374a4465fe72809cecb69d3ebb9562. --- .../ulm_templates/actions/actions_card.yaml | 57 +++++++++----- .../ulm_templates/actions/actions_icon.yaml | 78 ++++++++++++++----- .../ulm_templates/actions/actions_name.yaml | 78 ++++++++++++++----- .../popups/popup_light_brightness.yaml | 38 ++++++--- .../popups/popup_light_color.yaml | 38 ++++++--- .../popups/popup_light_color_temp.yaml | 38 ++++++--- .../popups/popup_media_player_infos.yaml | 19 +++-- .../popups/popup_media_player_volume.yaml | 19 +++-- .../popups/popup_power_outlet_history.yaml | 19 +++-- .../popups/popup_power_outlet_stats.yaml | 19 +++-- .../popups/popup_weather_forecast.yaml | 19 +++-- .../popups/popup_weather_radar.yaml | 19 +++-- 12 files changed, 315 insertions(+), 126 deletions(-) diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card.yaml index f6e971785..a90c8b2b9 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card.yaml @@ -62,12 +62,19 @@ ulm_actions_card: data: large: true hide_header: true - style: | - :host { - --popup-background-color: var(--primary-background-color); - --popup-border-radius: 0px; - --popup-padding: 20px 24px; - } + style: + .: | + :host { + --mdc-theme-surface: var(--primary-background-color); + --secondary-background-color: var(--primary-background-color); + } + $: | + .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { + border-radius: 0px; + } + :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { + padding: 20px 24px; + } content: type: "custom:button-card" template: > @@ -161,12 +168,19 @@ ulm_actions_card: data: large: true hide_header: true - style: | - :host { - --popup-background-color: var(--primary-background-color); - --popup-border-radius: 0px; - --popup-padding: 20px 24px; - } + style: + .: | + :host { + --mdc-theme-surface: var(--primary-background-color); + --secondary-background-color: var(--primary-background-color); + } + $: | + .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { + border-radius: 0px; + } + :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { + padding: 20px 24px; + } content: type: "custom:button-card" template: > @@ -260,12 +274,19 @@ ulm_actions_card: data: large: true hide_header: true - style: | - :host { - --popup-background-color: var(--primary-background-color); - --popup-border-radius: 0px; - --popup-padding: 20px 24px; - } + style: + .: | + :host { + --mdc-theme-surface: var(--primary-background-color); + --secondary-background-color: var(--primary-background-color); + } + $: | + .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { + border-radius: 0px; + } + :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { + padding: 20px 24px; + } content: type: "custom:button-card" template: > diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_icon.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_icon.yaml index 4c8d8ec45..cf226afcf 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_icon.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_icon.yaml @@ -62,12 +62,26 @@ ulm_actions_icon: data: large: true hide_header: true - style: | - :host { - --popup-background-color: var(--primary-background-color); - --popup-border-radius: 0px; - --popup-padding: 20px 24px; - } + style: + $: | + :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { + padding: 20px 24px; + } + @media (max-width: 450px), (max-height: 500px) { + .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { + border-radius: 0px; + } + } + .: | + @media (max-width: 450px), (max-height: 500px) { + ha-dialog { + --ha-card-border-radius: 0px; + } + } + :host { + --mdc-theme-surface: var(--primary-background-color); + --secondary-background-color: var(--primary-background-color); + } content: type: "custom:button-card" template: > @@ -171,12 +185,26 @@ ulm_actions_icon: data: large: true hide_header: true - style: | - :host { - --popup-background-color: var(--primary-background-color); - --popup-border-radius: 0px; - --popup-padding: 20px 24px; - } + style: + $: | + :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { + padding: 20px 24px; + } + @media (max-width: 450px), (max-height: 500px) { + .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { + border-radius: 0px; + } + } + .: | + @media (max-width: 450px), (max-height: 500px) { + ha-dialog { + --ha-card-border-radius: 0px; + } + } + :host { + --mdc-theme-surface: var(--primary-background-color); + --secondary-background-color: var(--primary-background-color); + } content: type: "custom:button-card" template: > @@ -284,12 +312,26 @@ ulm_actions_icon: data: large: true hide_header: true - style: | - :host { - --popup-background-color: var(--primary-background-color); - --popup-border-radius: 0px; - --popup-padding: 20px 24px; - } + style: + $: | + :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { + padding: 20px 24px; + } + @media (max-width: 450px), (max-height: 500px) { + .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { + border-radius: 0px; + } + } + .: | + @media (max-width: 450px), (max-height: 500px) { + ha-dialog { + --ha-card-border-radius: 0px; + } + } + :host { + --mdc-theme-surface: var(--primary-background-color); + --secondary-background-color: var(--primary-background-color); + } content: type: "custom:button-card" template: > diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_name.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_name.yaml index 53e3d58ae..9914c693e 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_name.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_name.yaml @@ -62,12 +62,26 @@ ulm_actions_name: data: large: true hide_header: true - style: | - :host { - --popup-background-color: var(--primary-background-color); - --popup-border-radius: 0px; - --popup-padding: 20px 24px; - } + style: + $: | + :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { + padding: 20px 24px; + } + @media (max-width: 450px), (max-height: 500px) { + .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { + border-radius: 0px; + } + } + .: | + @media (max-width: 450px), (max-height: 500px) { + ha-dialog { + --ha-card-border-radius: 0px; + } + } + :host { + --mdc-theme-surface: var(--primary-background-color); + --secondary-background-color: var(--primary-background-color); + } content: type: "custom:button-card" template: > @@ -161,12 +175,26 @@ ulm_actions_name: data: large: true hide_header: true - style: | - :host { - --popup-background-color: var(--primary-background-color); - --popup-border-radius: 0px; - --popup-padding: 20px 24px; - } + style: + $: | + :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { + padding: 20px 24px; + } + @media (max-width: 450px), (max-height: 500px) { + .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { + border-radius: 0px; + } + } + .: | + @media (max-width: 450px), (max-height: 500px) { + ha-dialog { + --ha-card-border-radius: 0px; + } + } + :host { + --mdc-theme-surface: var(--primary-background-color); + --secondary-background-color: var(--primary-background-color); + } content: type: "custom:button-card" template: > @@ -260,12 +288,26 @@ ulm_actions_name: data: large: true hide_header: true - style: | - :host { - --popup-background-color: var(--primary-background-color); - --popup-border-radius: 0px; - --popup-padding: 20px 24px; - } + style: + $: | + :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { + padding: 20px 24px; + } + @media (max-width: 450px), (max-height: 500px) { + .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { + border-radius: 0px; + } + } + .: | + @media (max-width: 450px), (max-height: 500px) { + ha-dialog { + --ha-card-border-radius: 0px; + } + } + :host { + --mdc-theme-surface: var(--primary-background-color); + --secondary-background-color: var(--primary-background-color); + } content: type: "custom:button-card" template: > diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_brightness.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_brightness.yaml index f08c8e379..58ae2ccc4 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_brightness.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_brightness.yaml @@ -287,12 +287,19 @@ popup_light_brightness: service: "browser_mod.popup" data: hide_header: true - style: | - :host { - --popup-background-color: var(--primary-background-color); - --popup-border-radius: 0px; - --popup-padding: 20px 24px; - } + style: + .: | + :host { + --mdc-theme-surface: var(--primary-background-color); + --secondary-background-color: var(--primary-background-color); + } + $: | + .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { + border-radius: 0px; + } + :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { + padding: 20px 24px; + } content: type: "custom:button-card" template: "popup_light_color_temp" @@ -320,12 +327,19 @@ popup_light_brightness: service: "browser_mod.popup" data: hide_header: true - style: | - :host { - --popup-background-color: var(--primary-background-color); - --popup-border-radius: 0px; - --popup-padding: 20px 24px; - } + style: + .: | + :host { + --mdc-theme-surface: var(--primary-background-color); + --secondary-background-color: var(--primary-background-color); + } + $: | + .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { + border-radius: 0px; + } + :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { + padding: 20px 24px; + } content: type: "custom:button-card" template: "popup_light_color" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color.yaml index 24c3ce7cf..8d73b5c6a 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color.yaml @@ -53,12 +53,19 @@ popup_light_color: service: "browser_mod.popup" data: hide_header: true - style: | - :host { - --popup-background-color: var(--primary-background-color); - --popup-border-radius: 0px; - --popup-padding: 20px 24px; - } + style: + .: | + :host { + --mdc-theme-surface: var(--primary-background-color); + --secondary-background-color: var(--primary-background-color); + } + $: | + .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { + border-radius: 0px; + } + :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { + padding: 20px 24px; + } content: type: "custom:button-card" template: "popup_light_brightness" @@ -76,12 +83,19 @@ popup_light_color: service: "browser_mod.popup" data: hide_header: true - style: | - :host { - --popup-background-color: var(--primary-background-color); - --popup-border-radius: 0px; - --popup-padding: 20px 24px; - } + style: + .: | + :host { + --mdc-theme-surface: var(--primary-background-color); + --secondary-background-color: var(--primary-background-color); + } + $: | + .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { + border-radius: 0px; + } + :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { + padding: 20px 24px; + } content: type: "custom:button-card" template: "popup_light_color_temp" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color_temp.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color_temp.yaml index 7e177dda5..ebcaea322 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color_temp.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color_temp.yaml @@ -53,12 +53,19 @@ popup_light_color_temp: service: "browser_mod.popup" data: hide_header: true - style: | - :host { - --popup-background-color: var(--primary-background-color); - --popup-border-radius: 0px; - --popup-padding: 20px 24px; - } + style: + .: | + :host { + --mdc-theme-surface: var(--primary-background-color); + --secondary-background-color: var(--primary-background-color); + } + $: | + .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { + border-radius: 0px; + } + :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { + padding: 20px 24px; + } content: type: "custom:button-card" template: "popup_light_brightness" @@ -84,12 +91,19 @@ popup_light_color_temp: service: "browser_mod.popup" data: hide_header: true - style: | - :host { - --popup-background-color: var(--primary-background-color); - --popup-border-radius: 0px; - --popup-padding: 20px 24px; - } + style: + .: | + :host { + --mdc-theme-surface: var(--primary-background-color); + --secondary-background-color: var(--primary-background-color); + } + $: | + .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { + border-radius: 0px; + } + :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { + padding: 20px 24px; + } content: type: "custom:button-card" template: "popup_light_color" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_infos.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_infos.yaml index c622b166b..5c56f9c8e 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_infos.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_infos.yaml @@ -226,12 +226,19 @@ popup_media_player_infos: service: "browser_mod.popup" data: hide_header: true - style: | - :host { - --popup-background-color: var(--primary-background-color); - --popup-border-radius: 0px; - --popup-padding: 20px 24px; - } + style: + .: | + :host { + --mdc-theme-surface: var(--primary-background-color); + --secondary-background-color: var(--primary-background-color); + } + $: | + .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { + border-radius: 0px; + } + :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { + padding: 20px 24px; + } content: type: "custom:button-card" template: "popup_media_player_volume" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_volume.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_volume.yaml index 0963ebd97..04946d72c 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_volume.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_volume.yaml @@ -67,12 +67,19 @@ popup_media_player_volume: service: "browser_mod.popup" data: hide_header: true - style: | - :host { - --popup-background-color: var(--primary-background-color); - --popup-border-radius: 0px; - --popup-padding: 20px 24px; - } + style: + .: | + :host { + --mdc-theme-surface: var(--primary-background-color); + --secondary-background-color: var(--primary-background-color); + } + $: | + .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { + border-radius: 0px; + } + :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { + padding: 20px 24px; + } content: type: "custom:button-card" template: "popup_media_player_infos" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_history.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_history.yaml index e90c4a4a4..f1106a99b 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_history.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_history.yaml @@ -48,12 +48,19 @@ popup_power_outlet_history: service: "browser_mod.popup" data: hide_header: true - style: | - :host { - --popup-background-color: var(--primary-background-color); - --popup-border-radius: 0px; - --popup-padding: 20px 24px; - } + style: + .: | + :host { + --mdc-theme-surface: var(--primary-background-color); + --secondary-background-color: var(--primary-background-color); + } + $: | + .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { + border-radius: 0px; + } + :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { + padding: 20px 24px; + } content: type: "custom:button-card" template: "popup_power_outlet_stats" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_stats.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_stats.yaml index d60059e9e..321934fbb 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_stats.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_stats.yaml @@ -134,12 +134,19 @@ popup_power_outlet_stats: service: "browser_mod.popup" data: hide_header: true - style: | - :host { - --popup-background-color: var(--primary-background-color); - --popup-border-radius: 0px; - --popup-padding: 20px 24px; - } + style: + .: | + :host { + --mdc-theme-surface: var(--primary-background-color); + --secondary-background-color: var(--primary-background-color); + } + $: | + .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { + border-radius: 0px; + } + :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { + padding: 20px 24px; + } content: type: "custom:button-card" template: "popup_power_outlet_history" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml index 09ef01758..e93714ac8 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml @@ -194,12 +194,19 @@ popup_weather_forecast: service: "browser_mod.popup" data: hide_header: true - style: | - :host { - --popup-background-color: var(--primary-background-color); - --popup-border-radius: 0px; - --popup-padding: 20px 24px; - } + style: + .: | + :host { + --mdc-theme-surface: var(--primary-background-color); + --secondary-background-color: var(--primary-background-color); + } + $: | + .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { + border-radius: 0px; + } + :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { + padding: 20px 24px; + } content: type: "custom:button-card" template: "popup_weather_radar" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_radar.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_radar.yaml index 1e70b5c7e..a324af8d5 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_radar.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_radar.yaml @@ -47,12 +47,19 @@ popup_weather_radar: service: "browser_mod.popup" data: hide_header: true - style: | - :host { - --popup-background-color: var(--primary-background-color); - --popup-border-radius: 0px; - --popup-padding: 20px 24px; - } + style: + .: | + :host { + --mdc-theme-surface: var(--primary-background-color); + --secondary-background-color: var(--primary-background-color); + } + $: | + .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { + border-radius: 0px; + } + :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { + padding: 20px 24px; + } content: type: "custom:button-card" template: "popup_weather_forecast" From 23f1a2bdeacf1290af3e95fd44ee1d3091925080 Mon Sep 17 00:00:00 2001 From: basbruss <68892092+basbruss@users.noreply.github.com> Date: Tue, 6 Sep 2022 09:16:32 +0200 Subject: [PATCH 19/21] Revert "Revert "Adapt for upcoming style name changes in browser_mod"" This reverts commit 2516687884ed08669e276b56e5239952b1fb8442. --- .../ulm_templates/actions/actions_card.yaml | 57 +++++--------- .../ulm_templates/actions/actions_icon.yaml | 78 +++++-------------- .../ulm_templates/actions/actions_name.yaml | 78 +++++-------------- .../popups/popup_light_brightness.yaml | 38 +++------ .../popups/popup_light_color.yaml | 38 +++------ .../popups/popup_light_color_temp.yaml | 38 +++------ .../popups/popup_media_player_infos.yaml | 19 ++--- .../popups/popup_media_player_volume.yaml | 19 ++--- .../popups/popup_power_outlet_history.yaml | 19 ++--- .../popups/popup_power_outlet_stats.yaml | 19 ++--- .../popups/popup_weather_forecast.yaml | 19 ++--- .../popups/popup_weather_radar.yaml | 19 ++--- 12 files changed, 126 insertions(+), 315 deletions(-) diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card.yaml index a90c8b2b9..f6e971785 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card.yaml @@ -62,19 +62,12 @@ ulm_actions_card: data: large: true hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } + style: | + :host { + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding: 20px 24px; + } content: type: "custom:button-card" template: > @@ -168,19 +161,12 @@ ulm_actions_card: data: large: true hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } + style: | + :host { + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding: 20px 24px; + } content: type: "custom:button-card" template: > @@ -274,19 +260,12 @@ ulm_actions_card: data: large: true hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } + style: | + :host { + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding: 20px 24px; + } content: type: "custom:button-card" template: > diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_icon.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_icon.yaml index cf226afcf..4c8d8ec45 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_icon.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_icon.yaml @@ -62,26 +62,12 @@ ulm_actions_icon: data: large: true hide_header: true - style: - $: | - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - @media (max-width: 450px), (max-height: 500px) { - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - } - .: | - @media (max-width: 450px), (max-height: 500px) { - ha-dialog { - --ha-card-border-radius: 0px; - } - } - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } + style: | + :host { + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding: 20px 24px; + } content: type: "custom:button-card" template: > @@ -185,26 +171,12 @@ ulm_actions_icon: data: large: true hide_header: true - style: - $: | - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - @media (max-width: 450px), (max-height: 500px) { - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - } - .: | - @media (max-width: 450px), (max-height: 500px) { - ha-dialog { - --ha-card-border-radius: 0px; - } - } - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } + style: | + :host { + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding: 20px 24px; + } content: type: "custom:button-card" template: > @@ -312,26 +284,12 @@ ulm_actions_icon: data: large: true hide_header: true - style: - $: | - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - @media (max-width: 450px), (max-height: 500px) { - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - } - .: | - @media (max-width: 450px), (max-height: 500px) { - ha-dialog { - --ha-card-border-radius: 0px; - } - } - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } + style: | + :host { + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding: 20px 24px; + } content: type: "custom:button-card" template: > diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_name.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_name.yaml index 9914c693e..53e3d58ae 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_name.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_name.yaml @@ -62,26 +62,12 @@ ulm_actions_name: data: large: true hide_header: true - style: - $: | - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - @media (max-width: 450px), (max-height: 500px) { - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - } - .: | - @media (max-width: 450px), (max-height: 500px) { - ha-dialog { - --ha-card-border-radius: 0px; - } - } - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } + style: | + :host { + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding: 20px 24px; + } content: type: "custom:button-card" template: > @@ -175,26 +161,12 @@ ulm_actions_name: data: large: true hide_header: true - style: - $: | - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - @media (max-width: 450px), (max-height: 500px) { - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - } - .: | - @media (max-width: 450px), (max-height: 500px) { - ha-dialog { - --ha-card-border-radius: 0px; - } - } - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } + style: | + :host { + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding: 20px 24px; + } content: type: "custom:button-card" template: > @@ -288,26 +260,12 @@ ulm_actions_name: data: large: true hide_header: true - style: - $: | - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } - @media (max-width: 450px), (max-height: 500px) { - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - } - .: | - @media (max-width: 450px), (max-height: 500px) { - ha-dialog { - --ha-card-border-radius: 0px; - } - } - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } + style: | + :host { + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding: 20px 24px; + } content: type: "custom:button-card" template: > diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_brightness.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_brightness.yaml index 58ae2ccc4..f08c8e379 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_brightness.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_brightness.yaml @@ -287,19 +287,12 @@ popup_light_brightness: service: "browser_mod.popup" data: hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } + style: | + :host { + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding: 20px 24px; + } content: type: "custom:button-card" template: "popup_light_color_temp" @@ -327,19 +320,12 @@ popup_light_brightness: service: "browser_mod.popup" data: hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } + style: | + :host { + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding: 20px 24px; + } content: type: "custom:button-card" template: "popup_light_color" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color.yaml index 8d73b5c6a..24c3ce7cf 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color.yaml @@ -53,19 +53,12 @@ popup_light_color: service: "browser_mod.popup" data: hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } + style: | + :host { + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding: 20px 24px; + } content: type: "custom:button-card" template: "popup_light_brightness" @@ -83,19 +76,12 @@ popup_light_color: service: "browser_mod.popup" data: hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } + style: | + :host { + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding: 20px 24px; + } content: type: "custom:button-card" template: "popup_light_color_temp" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color_temp.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color_temp.yaml index ebcaea322..7e177dda5 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color_temp.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color_temp.yaml @@ -53,19 +53,12 @@ popup_light_color_temp: service: "browser_mod.popup" data: hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } + style: | + :host { + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding: 20px 24px; + } content: type: "custom:button-card" template: "popup_light_brightness" @@ -91,19 +84,12 @@ popup_light_color_temp: service: "browser_mod.popup" data: hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } + style: | + :host { + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding: 20px 24px; + } content: type: "custom:button-card" template: "popup_light_color" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_infos.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_infos.yaml index 5c56f9c8e..c622b166b 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_infos.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_infos.yaml @@ -226,19 +226,12 @@ popup_media_player_infos: service: "browser_mod.popup" data: hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } + style: | + :host { + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding: 20px 24px; + } content: type: "custom:button-card" template: "popup_media_player_volume" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_volume.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_volume.yaml index 04946d72c..0963ebd97 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_volume.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_volume.yaml @@ -67,19 +67,12 @@ popup_media_player_volume: service: "browser_mod.popup" data: hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } + style: | + :host { + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding: 20px 24px; + } content: type: "custom:button-card" template: "popup_media_player_infos" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_history.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_history.yaml index f1106a99b..e90c4a4a4 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_history.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_history.yaml @@ -48,19 +48,12 @@ popup_power_outlet_history: service: "browser_mod.popup" data: hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } + style: | + :host { + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding: 20px 24px; + } content: type: "custom:button-card" template: "popup_power_outlet_stats" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_stats.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_stats.yaml index 321934fbb..d60059e9e 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_stats.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_stats.yaml @@ -134,19 +134,12 @@ popup_power_outlet_stats: service: "browser_mod.popup" data: hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } + style: | + :host { + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding: 20px 24px; + } content: type: "custom:button-card" template: "popup_power_outlet_history" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml index e93714ac8..09ef01758 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml @@ -194,19 +194,12 @@ popup_weather_forecast: service: "browser_mod.popup" data: hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } + style: | + :host { + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding: 20px 24px; + } content: type: "custom:button-card" template: "popup_weather_radar" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_radar.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_radar.yaml index a324af8d5..1e70b5c7e 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_radar.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_radar.yaml @@ -47,19 +47,12 @@ popup_weather_radar: service: "browser_mod.popup" data: hide_header: true - style: - .: | - :host { - --mdc-theme-surface: var(--primary-background-color); - --secondary-background-color: var(--primary-background-color); - } - $: | - .mdc-dialog .mdc-dialog__container .mdc-dialog__surface { - border-radius: 0px; - } - :host .mdc-dialog .mdc-dialog__container .mdc-dialog__surface .mdc-dialog__content { - padding: 20px 24px; - } + style: | + :host { + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding: 20px 24px; + } content: type: "custom:button-card" template: "popup_weather_forecast" From 012d4c55f06bc4843948adfe0613f864d71adb20 Mon Sep 17 00:00:00 2001 From: basbruss <68892092+basbruss@users.noreply.github.com> Date: Tue, 6 Sep 2022 10:28:11 +0200 Subject: [PATCH 20/21] Remove unnecessary :host --- .../ulm_templates/actions/actions_card.yaml | 27 +++++++++---------- .../ulm_templates/actions/actions_icon.yaml | 27 +++++++++---------- .../ulm_templates/actions/actions_name.yaml | 27 +++++++++---------- .../popups/popup_light_brightness.yaml | 18 ++++++------- .../popups/popup_light_color.yaml | 18 ++++++------- .../popups/popup_light_color_temp.yaml | 18 ++++++------- .../popups/popup_media_player_infos.yaml | 9 +++---- .../popups/popup_media_player_volume.yaml | 9 +++---- .../popups/popup_power_outlet_history.yaml | 9 +++---- .../popups/popup_power_outlet_stats.yaml | 9 +++---- .../popups/popup_weather_forecast.yaml | 9 +++---- .../popups/popup_weather_radar.yaml | 9 +++---- 12 files changed, 84 insertions(+), 105 deletions(-) diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card.yaml index f6e971785..25296463f 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_card.yaml @@ -63,11 +63,10 @@ ulm_actions_card: large: true hide_header: true style: | - :host { - --popup-background-color: var(--primary-background-color); - --popup-border-radius: 0px; - --popup-padding: 20px 24px; - } + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding-x: 24px; + --popup-padding-y: 20px; content: type: "custom:button-card" template: > @@ -162,11 +161,10 @@ ulm_actions_card: large: true hide_header: true style: | - :host { - --popup-background-color: var(--primary-background-color); - --popup-border-radius: 0px; - --popup-padding: 20px 24px; - } + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding-x: 24px; + --popup-padding-y: 20px; content: type: "custom:button-card" template: > @@ -261,11 +259,10 @@ ulm_actions_card: large: true hide_header: true style: | - :host { - --popup-background-color: var(--primary-background-color); - --popup-border-radius: 0px; - --popup-padding: 20px 24px; - } + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding-x: 24px; + --popup-padding-y: 20px; content: type: "custom:button-card" template: > diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_icon.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_icon.yaml index 4c8d8ec45..4e291102a 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_icon.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_icon.yaml @@ -63,11 +63,10 @@ ulm_actions_icon: large: true hide_header: true style: | - :host { - --popup-background-color: var(--primary-background-color); - --popup-border-radius: 0px; - --popup-padding: 20px 24px; - } + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding-x: 24px; + --popup-padding-y: 20px; content: type: "custom:button-card" template: > @@ -172,11 +171,10 @@ ulm_actions_icon: large: true hide_header: true style: | - :host { - --popup-background-color: var(--primary-background-color); - --popup-border-radius: 0px; - --popup-padding: 20px 24px; - } + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding-x: 24px; + --popup-padding-y: 20px; content: type: "custom:button-card" template: > @@ -285,11 +283,10 @@ ulm_actions_icon: large: true hide_header: true style: | - :host { - --popup-background-color: var(--primary-background-color); - --popup-border-radius: 0px; - --popup-padding: 20px 24px; - } + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding-x: 24px; + --popup-padding-y: 20px; content: type: "custom:button-card" template: > diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_name.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_name.yaml index 53e3d58ae..1a8217b3f 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_name.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_name.yaml @@ -63,11 +63,10 @@ ulm_actions_name: large: true hide_header: true style: | - :host { - --popup-background-color: var(--primary-background-color); - --popup-border-radius: 0px; - --popup-padding: 20px 24px; - } + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding-x: 24px; + --popup-padding-y: 20px; content: type: "custom:button-card" template: > @@ -162,11 +161,10 @@ ulm_actions_name: large: true hide_header: true style: | - :host { - --popup-background-color: var(--primary-background-color); - --popup-border-radius: 0px; - --popup-padding: 20px 24px; - } + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding-x: 24px; + --popup-padding-y: 20px; content: type: "custom:button-card" template: > @@ -261,11 +259,10 @@ ulm_actions_name: large: true hide_header: true style: | - :host { - --popup-background-color: var(--primary-background-color); - --popup-border-radius: 0px; - --popup-padding: 20px 24px; - } + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding-x: 24px; + --popup-padding-y: 20px; content: type: "custom:button-card" template: > diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_brightness.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_brightness.yaml index f08c8e379..e43b54f08 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_brightness.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_brightness.yaml @@ -288,11 +288,10 @@ popup_light_brightness: data: hide_header: true style: | - :host { - --popup-background-color: var(--primary-background-color); - --popup-border-radius: 0px; - --popup-padding: 20px 24px; - } + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding-x: 24px; + --popup-padding-y: 20px; content: type: "custom:button-card" template: "popup_light_color_temp" @@ -321,11 +320,10 @@ popup_light_brightness: data: hide_header: true style: | - :host { - --popup-background-color: var(--primary-background-color); - --popup-border-radius: 0px; - --popup-padding: 20px 24px; - } + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding-x: 24px; + --popup-padding-y: 20px; content: type: "custom:button-card" template: "popup_light_color" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color.yaml index 24c3ce7cf..3a539bd11 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color.yaml @@ -54,11 +54,10 @@ popup_light_color: data: hide_header: true style: | - :host { - --popup-background-color: var(--primary-background-color); - --popup-border-radius: 0px; - --popup-padding: 20px 24px; - } + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding-x: 24px; + --popup-padding-y: 20px; content: type: "custom:button-card" template: "popup_light_brightness" @@ -77,11 +76,10 @@ popup_light_color: data: hide_header: true style: | - :host { - --popup-background-color: var(--primary-background-color); - --popup-border-radius: 0px; - --popup-padding: 20px 24px; - } + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding-x: 24px; + --popup-padding-y: 20px; content: type: "custom:button-card" template: "popup_light_color_temp" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color_temp.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color_temp.yaml index 7e177dda5..009a9ddf2 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color_temp.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_light_color_temp.yaml @@ -54,11 +54,10 @@ popup_light_color_temp: data: hide_header: true style: | - :host { - --popup-background-color: var(--primary-background-color); - --popup-border-radius: 0px; - --popup-padding: 20px 24px; - } + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding-x: 24px; + --popup-padding-y: 20px; content: type: "custom:button-card" template: "popup_light_brightness" @@ -85,11 +84,10 @@ popup_light_color_temp: data: hide_header: true style: | - :host { - --popup-background-color: var(--primary-background-color); - --popup-border-radius: 0px; - --popup-padding: 20px 24px; - } + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding-x: 24px; + --popup-padding-y: 20px; content: type: "custom:button-card" template: "popup_light_color" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_infos.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_infos.yaml index c622b166b..3fbeae037 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_infos.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_infos.yaml @@ -227,11 +227,10 @@ popup_media_player_infos: data: hide_header: true style: | - :host { - --popup-background-color: var(--primary-background-color); - --popup-border-radius: 0px; - --popup-padding: 20px 24px; - } + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding-x: 24px; + --popup-padding-y: 20px; content: type: "custom:button-card" template: "popup_media_player_volume" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_volume.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_volume.yaml index 0963ebd97..bbfa60ebc 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_volume.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_media_player_volume.yaml @@ -68,11 +68,10 @@ popup_media_player_volume: data: hide_header: true style: | - :host { - --popup-background-color: var(--primary-background-color); - --popup-border-radius: 0px; - --popup-padding: 20px 24px; - } + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding-x: 24px; + --popup-padding-y: 20px; content: type: "custom:button-card" template: "popup_media_player_infos" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_history.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_history.yaml index e90c4a4a4..efa39b2e6 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_history.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_history.yaml @@ -49,11 +49,10 @@ popup_power_outlet_history: data: hide_header: true style: | - :host { - --popup-background-color: var(--primary-background-color); - --popup-border-radius: 0px; - --popup-padding: 20px 24px; - } + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding-x: 24px; + --popup-padding-y: 20px; content: type: "custom:button-card" template: "popup_power_outlet_stats" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_stats.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_stats.yaml index d60059e9e..0e204d2d5 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_stats.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_power_outlet_stats.yaml @@ -135,11 +135,10 @@ popup_power_outlet_stats: data: hide_header: true style: | - :host { - --popup-background-color: var(--primary-background-color); - --popup-border-radius: 0px; - --popup-padding: 20px 24px; - } + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding-x: 24px; + --popup-padding-y: 20px; content: type: "custom:button-card" template: "popup_power_outlet_history" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml index 09ef01758..1afcb0299 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_forecast.yaml @@ -195,11 +195,10 @@ popup_weather_forecast: data: hide_header: true style: | - :host { - --popup-background-color: var(--primary-background-color); - --popup-border-radius: 0px; - --popup-padding: 20px 24px; - } + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding-x: 24px; + --popup-padding-y: 20px; content: type: "custom:button-card" template: "popup_weather_radar" diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_radar.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_radar.yaml index 1e70b5c7e..67bea3205 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_radar.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/popup_templates/popups/popup_weather_radar.yaml @@ -48,11 +48,10 @@ popup_weather_radar: data: hide_header: true style: | - :host { - --popup-background-color: var(--primary-background-color); - --popup-border-radius: 0px; - --popup-padding: 20px 24px; - } + --popup-background-color: var(--primary-background-color); + --popup-border-radius: 0px; + --popup-padding-x: 24px; + --popup-padding-y: 20px; content: type: "custom:button-card" template: "popup_weather_forecast" From ed07ed9a76824c3b8f23c606f384777354e94811 Mon Sep 17 00:00:00 2001 From: basbruss <68892092+basbruss@users.noreply.github.com> Date: Tue, 6 Sep 2022 10:43:39 +0200 Subject: [PATCH 21/21] Fix template logic --- .../ulm_templates/actions/actions_icon.yaml | 20 ------------------- 1 file changed, 20 deletions(-) diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_icon.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_icon.yaml index 17ae3193c..9bc2e7802 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_icon.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/actions/actions_icon.yaml @@ -71,16 +71,6 @@ ulm_actions_icon: type: "custom:button-card" template: > [[[ - if (variables.ulm_card_light_enable_popup){ - return 'popup_light_brightness' - } - if (variables.ulm_card_thermostat_enable_popup){ - return 'popup_thermostat_temperature' - } - if (variables.ulm_card_media_player_enable_popup){ - return 'popup_media_player_infos' - } - if (variables.ulm_custom_popup != null ){ let popup_config = variables.ulm_custom_popup; if ((typeof popup_config === 'object') && 'template' in popup_config) { @@ -178,16 +168,6 @@ ulm_actions_icon: type: "custom:button-card" template: > [[[ - if (variables.ulm_card_light_enable_popup){ - return 'popup_light_brightness' - } - if (variables.ulm_card_thermostat_enable_popup){ - return 'popup_thermostat_temperature' - } - if (variables.ulm_card_media_player_enable_popup){ - return 'popup_media_player_infos' - } - if (variables.ulm_custom_popup != null ){ let popup_config = variables.ulm_custom_popup; if ((typeof popup_config === 'object') && 'template' in popup_config) {