From f2ca83be73b8f498592cbe1574db67bc5a3a5c76 Mon Sep 17 00:00:00 2001 From: shogun160 <63370033+shogun160@users.noreply.github.com> Date: Fri, 10 Mar 2023 21:32:25 +0100 Subject: [PATCH 1/7] Update card_weather.yaml use entity temperature when ulm_card_weather_custom isn't set --- .../ulm_templates/card_templates/cards/card_weather.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_weather.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_weather.yaml index 9f51362e3..454efca37 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_weather.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_weather.yaml @@ -7,6 +7,8 @@ card_weather: ulm_card_weather_backdrop: false ulm_card_weather_primary_info: "extrema" ulm_card_weather_secondary_info: "precipitation" + ulm_card_weather_custom: + - temp: '[[[ return entity.attributes.temperature ]]]' show_icon: false show_name: false show_label: false @@ -29,6 +31,7 @@ card_weather: primary_info: "[[[ return variables.ulm_card_weather_primary_info ]]]" secondary_info: "[[[ return variables.ulm_card_weather_secondary_info ]]]" backdrop: "[[[ return variables.ulm_card_weather_backdrop ]]]" + custom: "[[[ return variables?.ulm_card_weather_custom ]]]" style: | ha-card { border-radius: 14px; From 6344508c2acf85e4b602e506c70d06c3a2471500 Mon Sep 17 00:00:00 2001 From: shogun160 <63370033+shogun160@users.noreply.github.com> Date: Fri, 10 Mar 2023 21:36:37 +0100 Subject: [PATCH 2/7] Update card_weather.yaml --- .../ulm_templates/card_templates/cards/card_weather.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_weather.yaml b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_weather.yaml index 454efca37..dc7604f73 100644 --- a/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_weather.yaml +++ b/custom_components/ui_lovelace_minimalist/lovelace/ulm_templates/card_templates/cards/card_weather.yaml @@ -8,7 +8,7 @@ card_weather: ulm_card_weather_primary_info: "extrema" ulm_card_weather_secondary_info: "precipitation" ulm_card_weather_custom: - - temp: '[[[ return entity.attributes.temperature ]]]' + - temp: "[[[ return entity.attributes.temperature ]]]" show_icon: false show_name: false show_label: false From 3cfc6ce0ee018b29f4e77240b0e6e98710fa4001 Mon Sep 17 00:00:00 2001 From: shogun160 <63370033+shogun160@users.noreply.github.com> Date: Mon, 13 Mar 2023 16:03:36 +0100 Subject: [PATCH 3/7] Update card_battery.yaml --- .../card_templates/cards/card_battery.yaml | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) 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 834ca3dd4..c9b7c4e4b 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 @@ -8,7 +8,8 @@ card_battery: ulm_card_battery_name: "[[[ return entity.attributes.friendly_name ]]]" ulm_card_battery_attribute: ulm_card_battery_battery_state_entity_id: - ulm_card_battery_charger_type_entity_id: + ulm_card_battery_charger_type_entity_id: + ulm_card_battery_charging_animation: false ulm_card_battery_battery_level_danger: ulm_card_battery_battery_level_warning: ulm_card_battery_color_battery_level_danger: "var(--google-red)" @@ -52,6 +53,7 @@ card_battery: if (variables.ulm_card_battery_charger_type_entity_id == null) { // Check wether the battery state is charging infix = variables.ulm_card_battery_battery_state_entity_id !== null && + variables.ulm_card_battery_charging_animation === false && states[variables.ulm_card_battery_battery_state_entity_id].state.toLowerCase() === "charging" ? "-charging" : "" } else { @@ -86,6 +88,17 @@ card_battery: } return icon; ]]] + extra_styles: | + @keyframes charge { + 0%, 80% { clip-path: inset(0 0 0 0); } + 10% { clip-path: polygon(0% 0%, 0% 100%, 34% 100%, 34% 40%, 66% 40%, 66% 66%, 34% 66%, 34% 100%, 100% 100%, 100% 0%); } + 20% { clip-path: polygon(0% 0%, 0% 100%, 34% 100%, 34% 40%, 66% 40%, 66% 62%, 34% 62%, 34% 100%, 100% 100%, 100% 0%); } + 30% { clip-path: polygon(0% 0%, 0% 100%, 34% 100%, 34% 40%, 66% 40%, 66% 58%, 34% 58%, 34% 100%, 100% 100%, 100% 0%); } + 40% { clip-path: polygon(0% 0%, 0% 100%, 34% 100%, 34% 40%, 66% 40%, 66% 54%, 34% 54%, 34% 100%, 100% 100%, 100% 0%); } + 50% { clip-path: polygon(0% 0%, 0% 100%, 34% 100%, 34% 40%, 66% 40%, 66% 50%, 34% 50%, 34% 100%, 100% 100%, 100% 0%); } + 60% { clip-path: polygon(0% 0%, 0% 100%, 34% 100%, 34% 40%, 66% 40%, 66% 46%, 34% 46%, 34% 100%, 100% 100%, 100% 0%); } + 70% { clip-path: polygon(0% 0%, 0% 100%, 34% 100%, 34% 40%, 66% 40%, 66% 40%, 34% 40%, 34% 100%, 100% 100%, 100% 0%); } + } styles: icon: - color: | @@ -108,6 +121,15 @@ card_battery: } return color; ]]] + - animation: | + [[[ + if (variables.ulm_card_battery_battery_state_entity_id !== null && + variables.ulm_card_battery_charging_animation === true && + states[variables.ulm_card_battery_battery_state_entity_id].state.toLowerCase() === "charging"){ + return "charge 3s linear infinite" + } + return "none" + ]]] item2: card: type: "custom:button-card" From 98c1d7d8bf969428dbcbaf628681ba2ccfb1c4f3 Mon Sep 17 00:00:00 2001 From: shogun160 <63370033+shogun160@users.noreply.github.com> Date: Mon, 13 Mar 2023 16:58:04 +0100 Subject: [PATCH 4/7] Update card_battery.md --- docs/usage/cards/card_battery.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/usage/cards/card_battery.md b/docs/usage/cards/card_battery.md index be9e75b20..0e63da1b7 100644 --- a/docs/usage/cards/card_battery.md +++ b/docs/usage/cards/card_battery.md @@ -7,7 +7,13 @@ hide: ## Description -![example-image](../../assets/img/ulm_cards/card_battery.png){ width="500" } +![example-image](../../assets/img/ulm_cards/card_battery.png) + +Charging animation if `ulm_card_battery_charging_animation` is tue: + + + + The `battery-card` is a slightly enhanced `generic-card`, that can indicate whether and how a device is being charged and colors the icon based on the battery level. @@ -20,6 +26,7 @@ The `battery-card` is a slightly enhanced `generic-card`, that can indicate whet | ulm_card_battery_attribute | | :material-close: | If your entity provides the battery percent in an attribute (= not as an own sensor), fill in the attribute's name here. E.g. if you have `sensor.livingroom_thermometer` and the attribute for your battery power is `sensor.livingroom_thermometer.attributes.battery_percent`, you fill in battery_percent here. | | ulm_card_battery_battery_state_entity_id | | :material-close: | Entity that holds the battery state (charging/discharging). If provided, the Icon will display the current status. | | ulm_card_battery_charger_type_entity_id | | :material-close: | Entity that holds the charger type (ac/wireless/none). This Entity replaces the need for the `ulm_card_battery_battery_state_entity_id` entity. If provided, the Icon will display the current charger type. This is only useful if you charge your devices Wireless and with cable. | +| ulm_card_battery_charging_animation | `false` | :material-close: | Weather to show charging animation or not. If set tot `true`, `ulm_card_battery_battery_state_entity_id` needs to be defined and `ulm_card_battery_charger_type_entity_id` will be ignored. | | ulm_card_battery_battery_level_danger | | :material-check: | Changes the color of the Icon, if the battery level falls below the provided value. Must be higher than `ulm_card_battery_battery_level_waring` | | ulm_card_battery_battery_level_waring | | :material-check: | Changes the color of the Icon, if the battery level falls below the provided value. | | ulm_card_battery_color_battery_level_danger | var(--google-red) | :material-close: | Color of icon if battery level is within the 'danger' zone. | From cc6fdeea56b54df7b6e15316b59fb20064525fd5 Mon Sep 17 00:00:00 2001 From: shogun160 <63370033+shogun160@users.noreply.github.com> Date: Mon, 13 Mar 2023 16:59:33 +0100 Subject: [PATCH 5/7] Update card_battery.yaml --- .../card_templates/cards/card_battery.yaml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 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 c9b7c4e4b..00f38e0aa 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 @@ -29,7 +29,6 @@ card_battery: variables: > [[[ let vars = variables; - if(variables.ulm_outlet_power_enable_popup) { vars.ulm_custom_popup = { 'template': 'popup_power_outlet_stats', @@ -91,13 +90,13 @@ card_battery: extra_styles: | @keyframes charge { 0%, 80% { clip-path: inset(0 0 0 0); } - 10% { clip-path: polygon(0% 0%, 0% 100%, 34% 100%, 34% 40%, 66% 40%, 66% 66%, 34% 66%, 34% 100%, 100% 100%, 100% 0%); } - 20% { clip-path: polygon(0% 0%, 0% 100%, 34% 100%, 34% 40%, 66% 40%, 66% 62%, 34% 62%, 34% 100%, 100% 100%, 100% 0%); } - 30% { clip-path: polygon(0% 0%, 0% 100%, 34% 100%, 34% 40%, 66% 40%, 66% 58%, 34% 58%, 34% 100%, 100% 100%, 100% 0%); } - 40% { clip-path: polygon(0% 0%, 0% 100%, 34% 100%, 34% 40%, 66% 40%, 66% 54%, 34% 54%, 34% 100%, 100% 100%, 100% 0%); } - 50% { clip-path: polygon(0% 0%, 0% 100%, 34% 100%, 34% 40%, 66% 40%, 66% 50%, 34% 50%, 34% 100%, 100% 100%, 100% 0%); } - 60% { clip-path: polygon(0% 0%, 0% 100%, 34% 100%, 34% 40%, 66% 40%, 66% 46%, 34% 46%, 34% 100%, 100% 100%, 100% 0%); } - 70% { clip-path: polygon(0% 0%, 0% 100%, 34% 100%, 34% 40%, 66% 40%, 66% 40%, 34% 40%, 34% 100%, 100% 100%, 100% 0%); } + 10% { clip-path: polygon(0% 0%, 0% 100%, 33.5% 100%, 33.5% 40%, 66.5% 40%, 66.5% 66%, 33.5% 66%, 33.5% 100%, 100% 100%, 100% 0%); } + 20% { clip-path: polygon(0% 0%, 0% 100%, 33.5% 100%, 33.5% 40%, 66.5% 40%, 66.5% 62%, 33.5% 62%, 33.5% 100%, 100% 100%, 100% 0%); } + 30% { clip-path: polygon(0% 0%, 0% 100%, 33.5% 100%, 33.5% 40%, 66.5% 40%, 66.5% 58%, 33.5% 58%, 33.5% 100%, 100% 100%, 100% 0%); } + 40% { clip-path: polygon(0% 0%, 0% 100%, 33.5% 100%, 33.5% 40%, 66.5% 40%, 66.5% 54%, 33.5% 54%, 33.5% 100%, 100% 100%, 100% 0%); } + 50% { clip-path: polygon(0% 0%, 0% 100%, 33.5% 100%, 33.5% 40%, 66.5% 40%, 66.5% 50%, 33.5% 50%, 33.5% 100%, 100% 100%, 100% 0%); } + 60% { clip-path: polygon(0% 0%, 0% 100%, 33.5% 100%, 33.5% 40%, 66.5% 40%, 66.5% 46%, 33.5% 46%, 33.5% 100%, 100% 100%, 100% 0%); } + 70% { clip-path: polygon(0% 0%, 0% 100%, 33.5% 100%, 33.5% 40%, 66.5% 40%, 66.5% 40%, 33.5% 40%, 33.5% 100%, 100% 100%, 100% 0%); } } styles: icon: @@ -138,7 +137,6 @@ card_battery: variables: > [[[ let vars = variables; - if(variables.ulm_outlet_power_enable_popup) { vars.ulm_custom_popup = { 'template': 'popup_power_outlet_stats', From b273503b50cb9fda781a09fef9ec17f7a5cf162c Mon Sep 17 00:00:00 2001 From: shogun160 <63370033+shogun160@users.noreply.github.com> Date: Mon, 13 Mar 2023 17:01:53 +0100 Subject: [PATCH 6/7] Update card_battery.md --- docs/usage/cards/card_battery.md | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/docs/usage/cards/card_battery.md b/docs/usage/cards/card_battery.md index 0e63da1b7..be9e75b20 100644 --- a/docs/usage/cards/card_battery.md +++ b/docs/usage/cards/card_battery.md @@ -7,13 +7,7 @@ hide: ## Description -![example-image](../../assets/img/ulm_cards/card_battery.png) - -Charging animation if `ulm_card_battery_charging_animation` is tue: - - - - +![example-image](../../assets/img/ulm_cards/card_battery.png){ width="500" } The `battery-card` is a slightly enhanced `generic-card`, that can indicate whether and how a device is being charged and colors the icon based on the battery level. @@ -26,7 +20,6 @@ The `battery-card` is a slightly enhanced `generic-card`, that can indicate whet | ulm_card_battery_attribute | | :material-close: | If your entity provides the battery percent in an attribute (= not as an own sensor), fill in the attribute's name here. E.g. if you have `sensor.livingroom_thermometer` and the attribute for your battery power is `sensor.livingroom_thermometer.attributes.battery_percent`, you fill in battery_percent here. | | ulm_card_battery_battery_state_entity_id | | :material-close: | Entity that holds the battery state (charging/discharging). If provided, the Icon will display the current status. | | ulm_card_battery_charger_type_entity_id | | :material-close: | Entity that holds the charger type (ac/wireless/none). This Entity replaces the need for the `ulm_card_battery_battery_state_entity_id` entity. If provided, the Icon will display the current charger type. This is only useful if you charge your devices Wireless and with cable. | -| ulm_card_battery_charging_animation | `false` | :material-close: | Weather to show charging animation or not. If set tot `true`, `ulm_card_battery_battery_state_entity_id` needs to be defined and `ulm_card_battery_charger_type_entity_id` will be ignored. | | ulm_card_battery_battery_level_danger | | :material-check: | Changes the color of the Icon, if the battery level falls below the provided value. Must be higher than `ulm_card_battery_battery_level_waring` | | ulm_card_battery_battery_level_waring | | :material-check: | Changes the color of the Icon, if the battery level falls below the provided value. | | ulm_card_battery_color_battery_level_danger | var(--google-red) | :material-close: | Color of icon if battery level is within the 'danger' zone. | From ec08a888a41b9ea6e1dfccc3b348db5dc2b7fa9b Mon Sep 17 00:00:00 2001 From: shogun160 <63370033+shogun160@users.noreply.github.com> Date: Mon, 13 Mar 2023 17:03:28 +0100 Subject: [PATCH 7/7] Update card_battery.yaml --- .../card_templates/cards/card_battery.yaml | 26 +++---------------- 1 file changed, 3 insertions(+), 23 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 00f38e0aa..834ca3dd4 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 @@ -8,8 +8,7 @@ card_battery: ulm_card_battery_name: "[[[ return entity.attributes.friendly_name ]]]" ulm_card_battery_attribute: ulm_card_battery_battery_state_entity_id: - ulm_card_battery_charger_type_entity_id: - ulm_card_battery_charging_animation: false + ulm_card_battery_charger_type_entity_id: ulm_card_battery_battery_level_danger: ulm_card_battery_battery_level_warning: ulm_card_battery_color_battery_level_danger: "var(--google-red)" @@ -29,6 +28,7 @@ card_battery: variables: > [[[ let vars = variables; + if(variables.ulm_outlet_power_enable_popup) { vars.ulm_custom_popup = { 'template': 'popup_power_outlet_stats', @@ -52,7 +52,6 @@ card_battery: if (variables.ulm_card_battery_charger_type_entity_id == null) { // Check wether the battery state is charging infix = variables.ulm_card_battery_battery_state_entity_id !== null && - variables.ulm_card_battery_charging_animation === false && states[variables.ulm_card_battery_battery_state_entity_id].state.toLowerCase() === "charging" ? "-charging" : "" } else { @@ -87,17 +86,6 @@ card_battery: } return icon; ]]] - extra_styles: | - @keyframes charge { - 0%, 80% { clip-path: inset(0 0 0 0); } - 10% { clip-path: polygon(0% 0%, 0% 100%, 33.5% 100%, 33.5% 40%, 66.5% 40%, 66.5% 66%, 33.5% 66%, 33.5% 100%, 100% 100%, 100% 0%); } - 20% { clip-path: polygon(0% 0%, 0% 100%, 33.5% 100%, 33.5% 40%, 66.5% 40%, 66.5% 62%, 33.5% 62%, 33.5% 100%, 100% 100%, 100% 0%); } - 30% { clip-path: polygon(0% 0%, 0% 100%, 33.5% 100%, 33.5% 40%, 66.5% 40%, 66.5% 58%, 33.5% 58%, 33.5% 100%, 100% 100%, 100% 0%); } - 40% { clip-path: polygon(0% 0%, 0% 100%, 33.5% 100%, 33.5% 40%, 66.5% 40%, 66.5% 54%, 33.5% 54%, 33.5% 100%, 100% 100%, 100% 0%); } - 50% { clip-path: polygon(0% 0%, 0% 100%, 33.5% 100%, 33.5% 40%, 66.5% 40%, 66.5% 50%, 33.5% 50%, 33.5% 100%, 100% 100%, 100% 0%); } - 60% { clip-path: polygon(0% 0%, 0% 100%, 33.5% 100%, 33.5% 40%, 66.5% 40%, 66.5% 46%, 33.5% 46%, 33.5% 100%, 100% 100%, 100% 0%); } - 70% { clip-path: polygon(0% 0%, 0% 100%, 33.5% 100%, 33.5% 40%, 66.5% 40%, 66.5% 40%, 33.5% 40%, 33.5% 100%, 100% 100%, 100% 0%); } - } styles: icon: - color: | @@ -120,15 +108,6 @@ card_battery: } return color; ]]] - - animation: | - [[[ - if (variables.ulm_card_battery_battery_state_entity_id !== null && - variables.ulm_card_battery_charging_animation === true && - states[variables.ulm_card_battery_battery_state_entity_id].state.toLowerCase() === "charging"){ - return "charge 3s linear infinite" - } - return "none" - ]]] item2: card: type: "custom:button-card" @@ -137,6 +116,7 @@ card_battery: variables: > [[[ let vars = variables; + if(variables.ulm_outlet_power_enable_popup) { vars.ulm_custom_popup = { 'template': 'popup_power_outlet_stats',