Skip to content

Commit

Permalink
Merge branch 'release' into popup_weather_forecast_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
basbruss authored Aug 31, 2022
2 parents 95cff61 + f34ac86 commit e1cc4dd
Show file tree
Hide file tree
Showing 30 changed files with 860 additions and 57 deletions.
10 changes: 9 additions & 1 deletion custom_cards/custom_card_esh_room/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ hide:

## Credits

- Authors: Everything Smart Home - 2022 and mpeterson
- Authors:
- Everything Smart Home - 2022
- mpeterson
- rensknoors
- Full credit to user [bms on the forum](https://community.home-assistant.io/t/lovelace-ui-minimalist/322687/192), they created the design and base of it in full, EverythingSmartHome put it into a PR as the basis
- beasthouse and basbruss on the EverythingSmartHome discord channel for emoji/humidity customization
- mpeterson added support for a switch to control climate and also to remove the need to have an entity associated
Expand Down Expand Up @@ -44,6 +47,10 @@ Fixes text overflow issue over the climate button.
<summary>2.1.1</summary>
Add support for the new popup framework while maintaining backwards compatibility with the old one.
</details>
<details>
<summary>2.2.0</summary>
Introduces a new variable that lets you set the card background to the color of a light entity.
</details>

## Description

Expand All @@ -62,6 +69,7 @@ This is an alternative room card to the standard one that is more rectangular th
| ulm_custom_card_esh_room_climate_entity | | No | The entity to use for the climate button |
| ulm_card_light_enable_popup | `false` | No | Enable `popup_light` |
| ulm_card_thermostat_enable_popup | `false` | No | Enable `popup_thermostat` |
| ulm_card_ulm_card_dynamic_color | `false` | No | Enables dynamic background color (requires `ulm_custom_card_esh_room_light_entity`) |

## Usage

Expand Down
174 changes: 126 additions & 48 deletions custom_cards/custom_card_esh_room/custom_card_esh_room.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,45 +14,95 @@ card_esh_room:
ulm_custom_card_esh_room_climate_entity: null
ulm_card_thermostat_enable_popup: false
ulm_card_light_enable_popup: false
ulm_card_dynamic_color: false
label: >-
[[[
if (!entity) {
return "<br/>";
} else if (entity.state == "on"){
var bri = Math.round(entity.attributes.brightness / 2.55);
return (bri ? bri + "%" : variables.ulm_translation_state) ;
} else {
return variables.ulm_translation_state;
}
var label_entity = variables.ulm_custom_card_esh_room_light_entity
? states[variables.ulm_custom_card_esh_room_light_entity]
: entity;
if (!label_entity) {
return "<br />";
} else if (label_entity.state == "on") {
var bri = Math.round(label_entity.attributes.brightness / 2.55);
return (bri ? bri + "%" : variables.ulm_translation_state);
} else {
return variables.ulm_translation_state;
}
]]]
styles:
card:
- border-radius: "20px"
- box-shadow: "var(--box-shadow)"
- padding: "12px"
- background-color: >-
[[[
if (variables.ulm_custom_card_esh_room_light_entity) {
var color = states[variables.ulm_custom_card_esh_room_light_entity].attributes.rgb_color;
if (states[variables.ulm_custom_card_esh_room_light_entity].state == "on") {
if (color && variables.ulm_card_dynamic_color) {
return 'rgba(' + color + ', 0.2)';
}
return 'rgba(var(--color-background-yellow), 0.2)';
}
}
return 'var(--ha-card-background, var(--card-background-color, white))';
]]]
grid:
- grid-template-areas: >-
[[[
if (variables.ulm_custom_card_esh_room_light_entity && variables.ulm_custom_card_esh_room_climate_entity) {
return "'i light' 'n climate' 'l climate'";
return "'i light' 'n climate' 'l climate'";
} else if (variables.ulm_custom_card_esh_room_light_entity) {
return "'i light' 'n n' 'l l'";
return "'i light' 'n n' 'l l'";
} else if (variables.ulm_custom_card_esh_room_climate_entity) {
return "'i .' 'n climate' 'l climate'";
return "'i .' 'n climate' 'l climate'";
} else {
return "'i .' 'n n' 'l l'";
return "'i .' 'n n' 'l l'";
}
]]]
- grid-template-columns: "1fr 1fr"
- grid-template-rows: "min-content"
icon:
- color: "rgba(var(--color-theme),0.2)"
- filter: >-
[[[
if (variables.ulm_custom_card_esh_room_light_entity
&& states[variables.ulm_custom_card_esh_room_light_entity].state == "on"
&& variables.ulm_card_dynamic_color) {
return "contrast(0.6) saturate(1.7)";
}
]]]
- color: >-
[[[
if (variables.ulm_custom_card_esh_room_light_entity) {
var color = states[variables.ulm_custom_card_esh_room_light_entity].attributes.rgb_color;
if (states[variables.ulm_custom_card_esh_room_light_entity].state == "on") {
if (color && variables.ulm_card_dynamic_color) {
return 'rgba(' + color + ', 1)';
}
return 'rgba(var(--color-yellow), 1)';
}
}
return 'rgba(var(--color-theme), 0.2)';
]]]
img_cell:
- background-color: "rgba(var(--color-theme),0.05)"
- border-radius: "50%"
- place-self: "center"
- place-self: "flex-start"
- width: "42px"
- height: "42px"
- margin-left: "12px"
- background-color: >-
[[[
if (variables.ulm_custom_card_esh_room_light_entity) {
var color = states[variables.ulm_custom_card_esh_room_light_entity].attributes.rgb_color;
if (states[variables.ulm_custom_card_esh_room_light_entity].state == "on") {
if (color && variables.ulm_card_dynamic_color) {
return 'rgba(' + color + ', 0.3)';
}
return 'rgba(var(--color-yellow), 0.2)';
}
}
return 'rgba(var(--color-theme), 0.05)';
]]]
name:
- align-self: "end"
- justify-self: "start"
Expand All @@ -62,25 +112,47 @@ card_esh_room:
- margin-top: >-
[[[
if (variables.ulm_custom_card_esh_room_light_entity && variables.ulm_custom_card_esh_room_climate_entity) {
return "8px";
return "8px";
} else if (variables.ulm_custom_card_esh_room_light_entity) {
return "12px";
return "12px";
} else if (variables.ulm_custom_card_esh_room_climate_entity) {
return "8px";
return "8px";
} else {
return "12px";
return "12px";
}
]]]
- max-width: >-
[[[
if (variables.ulm_custom_card_esh_room_light_entity && variables.ulm_custom_card_esh_room_climate_entity) {
return "85%";
return "85%";
} else if (variables.ulm_custom_card_esh_room_light_entity) {
return "100%";
return "100%";
} else if (variables.ulm_custom_card_esh_room_climate_entity) {
return "85%";
return "85%";
} else {
return "100%";
return "100%";
}
]]]
- color: >-
[[[
if (variables.ulm_custom_card_esh_room_light_entity) {
var color = states[variables.ulm_custom_card_esh_room_light_entity].attributes.rgb_color;
if (states[variables.ulm_custom_card_esh_room_light_entity].state == "on") {
if (color && variables.ulm_card_dynamic_color) {
return 'rgba(' + color + ', 1)';
}
return 'rgba(var(color-yellow-text), 1)';
}
return 'rgba(var(--color-theme), 0.6)';
}
return 'rgba(var(--color-theme), 0.6)';
]]]
- filter: >-
[[[
if (variables.ulm_custom_card_esh_room_light_entity
&& states[variables.ulm_custom_card_esh_room_light_entity].state == "on"
&& variables.ulm_card_dynamic_color) {
return "contrast(0.6) saturate(1.7)";
}
]]]
label:
Expand All @@ -93,25 +165,25 @@ card_esh_room:
- margin-bottom: >-
[[[
if (variables.ulm_custom_card_esh_room_light_entity && variables.ulm_custom_card_esh_room_climate_entity) {
return "0px";
return "0px";
} else if (variables.ulm_custom_card_esh_room_light_entity) {
return "3px";
return "3px";
} else if (variables.ulm_custom_card_esh_room_climate_entity) {
return "0px";
return "0px";
} else {
return "3px";
return "3px";
}
]]]
- max-width: >-
[[[
if (variables.ulm_custom_card_esh_room_light_entity && variables.ulm_custom_card_esh_room_climate_entity) {
return "85%";
return "85%";
} else if (variables.ulm_custom_card_esh_room_light_entity) {
return "100%";
return "100%";
} else if (variables.ulm_custom_card_esh_room_climate_entity) {
return "85%";
return "85%";
} else {
return "100%";
return "100%";
}
]]]
state:
Expand All @@ -125,20 +197,20 @@ card_esh_room:
light:
- display: >
[[[
if (variables.ulm_custom_card_esh_room_light_entity) {
return "block";
} else {
return "none";
}
if (variables.ulm_custom_card_esh_room_light_entity) {
return "block";
} else {
return "none";
}
]]]
climate:
- display: >
[[[
if (variables.ulm_custom_card_esh_room_climate_entity) {
return "block";
} else {
return "none";
}
if (variables.ulm_custom_card_esh_room_climate_entity) {
return "block";
} else {
return "none";
}
]]]
custom_fields:
light:
Expand All @@ -150,9 +222,18 @@ card_esh_room:
icon: "mdi:lightbulb"
styles:
icon:
- color: "rgba(var(--color-yellow),1)"
- color: "rgba(var(--color-yellow), 1)"
img_cell:
- background-color: "rgba(var(--color-yellow), 0.2)"
- background-color: >-
[[[
if (variables.ulm_custom_card_esh_room_light_entity) {
var color = states[variables.ulm_custom_card_esh_room_light_entity].attributes.rgb_color;
if (color && variables.ulm_card_dynamic_color) {
return 'rgba(' + color + ', 0.3)';
}
}
return 'rgba(var(--color-yellow), 0.2)';
]]]
- value: "off"
icon: "mdi:lightbulb-off"
type: "custom:button-card"
Expand All @@ -163,8 +244,7 @@ card_esh_room:
[[[
let vars = {};
vars.ulm_card_light_enable_popup = variables.ulm_card_light_enable_popup;
if(variables.ulm_card_light_enable_popup) {
if (variables.ulm_card_light_enable_popup) {
vars.ulm_custom_popup = {
'template': 'popup_light_brightness',
'popup_variables': {
Expand All @@ -174,7 +254,6 @@ card_esh_room:
}
return vars;
]]]
climate:
card:
entity: "[[[ return variables.ulm_custom_card_esh_room_climate_entity ]]]"
Expand Down Expand Up @@ -235,8 +314,7 @@ card_esh_room:
[[[
let vars = {};
vars.ulm_card_thermostat_enable_popup = variables.ulm_card_light_enable_popup;
if(variables.ulm_card_thermostat_enable_popup) {
if (variables.ulm_card_thermostat_enable_popup) {
vars.ulm_custom_popup = {
'template': 'popup_thermostat_temperature',
'popup_variables': {
Expand Down
7 changes: 7 additions & 0 deletions custom_cards/custom_card_irmajavi_speedtest/languages/lv.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
ulm_custom_card_irmajavi_speedtest_language_variables:
variables:
## Latvian ##
ulm_custom_card_irmajavi_speedtest_speedtest: "Ātruma tests"
ulm_custom_card_irmajavi_speedtest_download: "lejuplādes ātrums"
ulm_custom_card_irmajavi_speedtest_upload: "augšupielādes ātrums"
61 changes: 61 additions & 0 deletions custom_cards/custom_template_shogun160_battery_info/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
title: Custom Template Battery Info
hide:
- toc
---

<!-- markdownlint-disable MD046 -->

# Custom Template "Battery Info"

<img width="249" alt="ui_minimalist_battery_info_example" src="https://user-images.githubusercontent.com/63370033/184395981-7fce5840-aa76-453d-8756-39b15e36d26c.png">

## Credits

- Full credit to user [basbruss](https://github.com/basbruss), who created the design and base of it in his person card

## Changelog

<details>
<summary>1.0.0</summary>
Initial release
</details>

## Description

This is an template to add the battery level to every ui minimalist card

## Variables

| Variable | Default | Required | Notes |
| -------------------------------------------- | ------- | -------- | ------------------------------------------------------------------------ |
| ulm_battery_entity | | No | The entity to represent the battery_level

## Usage with battery or battery_level attribute from entity

```yaml

- type: 'custom:button-card'
template:
- card_binary_sensor
- battery_info
entity: binary_sensor.badezimmer_tuer_contact
variables:
ulm_show_last_changed: false

```

## Usage with variable ulm_battery_entity

```yaml

- type: 'custom:button-card'
template:
- card_binary_sensor
- battery_info
entity: binary_sensor.badezimmer_tuer_contact
variables:
ulm_show_last_changed: false
ulm_battery_entity: sensor.badezimmer_tuer_battery_level

```
Loading

0 comments on commit e1cc4dd

Please sign in to comment.