Skip to content

Commit d03d50d

Browse files
authored
Merge branch 'dev' into main
2 parents 73dc1ca + a7f4177 commit d03d50d

File tree

165 files changed

+7480
-868
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

165 files changed

+7480
-868
lines changed

.devcontainer/configuration.yaml

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,31 +4,23 @@ default_config:
44
frontend:
55
themes: !include_dir_merge_named "themes"
66

7-
# For some reason default_config is not picking it up.
87
automation ui: !include "automations.yaml"
98

10-
# lovelace:
11-
# mode: "storage"
12-
13-
# sensor:
14-
# - platform: "time_date"
15-
169
logger:
1710
default: "info"
1811
logs:
1912
custom_components.ui_lovelace_minimalist: "debug"
20-
# If you need to debug uncommment the line below (doc: https://www.home-assistant.io/integrations/debugpy/)
21-
# debugpy:
2213

23-
#
24-
# Uncomment part below after installing dependencies
25-
#
26-
## Requirement for popups, install browser mod with hacs
2714
browser_mod:
28-
29-
## Install virtual integration with hacs
3015
virtual:
3116

17+
weather:
18+
- platform: "template"
19+
name: "DummyTown"
20+
condition_template: "cloudy"
21+
temperature_template: "{{ '20' | float }}"
22+
humidity_template: "{{ '50' | float }}"
23+
3224
light:
3325
- platform: "virtual"
3426
name: "Livingroom"
@@ -37,6 +29,7 @@ light:
3729
support_white_value: true
3830

3931
sensor:
32+
- platform: "time_date"
4033
- platform: "virtual"
4134
name: "Livingroom Temperature"
4235
class: "temperature"

.github/workflows/automatic-custom-card-docs.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,15 @@ jobs:
3030
replace: "../../assets/img"
3131
include: "docs/usage/custom_cards/**"
3232
regex: true
33-
- name: "Commit files"
34-
run: |
35-
git config --local user.email "[email protected]"
36-
git config --local user.name "GitHub Action"
37-
git pull -p
38-
git add --all
39-
git commit -a -m "Add changes for automatically custom_cards docs"
40-
- name: "Push changes"
41-
uses: "ad-m/github-push-action@master"
33+
- name: "Create Pull Request"
34+
uses: "peter-evans/create-pull-request@v3"
4235
with:
43-
github_token: "${{ secrets.GITHUB_TOKEN }}"
44-
branch: "${{ github.ref }}"
36+
token: "${{ secrets.GITHUB_TOKEN }}"
37+
branch: "automated_custom_card_docs"
38+
delete-branch: true
39+
commit-message: "Update docs"
40+
committer: "GitHub <[email protected]>"
41+
title: "[Action] Update custom_cards docs"
42+
labels: ":memo: documentation"
43+
body: |
44+
Update custom_cards docs due to latest changes.

custom_cards/custom_card_bar_card/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Version: 1.0.0
2020

2121
<details>
2222
<summary>1.0.0</summary>
23-
Initial release
23+
Initial release.
2424
</details>
2525

2626
## Requirements
Lines changed: 303 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,303 @@
1+
---
2+
title: custom_card_homeassistant_updates
3+
hide:
4+
- toc
5+
---
6+
<!-- markdownlint-disable MD046 -->
7+
8+
# Custom-card "Homeassistant updates"
9+
10+
![Homeassistant updates card](../../docs/assets/img/ulm_cards/card_homeassistant_updates.png)
11+
12+
!! Attention !!
13+
14+
This card needs additional template sensors and a group.updaters sensor to work, all detail can be found in this readme.
15+
16+
## Credits
17+
18+
- Author: AndyVRD - 2021
19+
- Special thanks to [basbruss](https://github.com/basbruss/UI)
20+
- Version: 1.0.0
21+
22+
## Changelog
23+
24+
<details>
25+
<summary>1.0.0</summary>
26+
Initial release
27+
</details>
28+
29+
## Usage
30+
31+
```yaml
32+
- type: 'custom:button-card'
33+
template: card_homeassistant_updates
34+
variables:
35+
ulm_card_homeassistant_entity: 'group.updaters'
36+
ulm_card_homeassistant_core: "sensor.core_updates"
37+
ulm_card_homeassistant_supervisor: "sensor.supervisor_updates"
38+
ulm_card_homeassistant_os: "sensor.os_updates"
39+
```
40+
41+
## Requirements
42+
43+
n/a
44+
45+
## Variables
46+
47+
<table>
48+
<tr>
49+
<th>Variable</th>
50+
<th>Example</th>
51+
<th>Required</th>
52+
<th>Explanation</th>
53+
</tr>
54+
<tr>
55+
<td>entity_</td>
56+
<td>group.updaters</td>
57+
<td>yes</td>
58+
<td>Group of template sensors</td>
59+
</tr>
60+
<tr>
61+
<td>core_</td>
62+
<td>sensor.core_updates</td>
63+
<td>yes</td>
64+
<td>sensor core installed/latest version</td>
65+
</tr>
66+
<tr>
67+
<td>os_</td>
68+
<td>sensor.os_updates</td>
69+
<td>no</td>
70+
<td>sensor os installed/latest version</td>
71+
</tr>
72+
<tr>
73+
<td>supervisor_</td>
74+
<td>sensor.supervisor_updates</td>
75+
<td>no</td>
76+
<td>sensor supervisor installed/latest version</td>
77+
</tr>
78+
</table>
79+
80+
## Template code
81+
82+
```yaml
83+
---
84+
card_homeassistant_updates:
85+
triggers_update: "all"
86+
styles:
87+
grid:
88+
- grid-template-areas: "'item1' 'item2'"
89+
- grid-template-columns: "1fr"
90+
- grid-template-rows: "min-content min-content"
91+
- row-gap: "12px"
92+
card:
93+
- border-radius: "var(--border-radius)"
94+
- box-shadow: "var(--box-shadow)"
95+
- padding: "12px"
96+
custom_fields:
97+
item1:
98+
card:
99+
triggers_update: "all"
100+
type: "custom:button-card"
101+
template:
102+
- "icon_info_updates"
103+
- "ulm_language_variables"
104+
icon: 'mdi:home-assistant'
105+
tap_action:
106+
action: "none"
107+
entity: "[[[ return variables.ulm_card_homeassistant_entity ]]]"
108+
name: >
109+
[[[
110+
if(states[variables.ulm_card_homeassistant_core].state ==='True' || states[variables.ulm_card_homeassistant_supervisor].state ==='True' || states[variables.ulm_card_homeassistant_os].state ==='True'){
111+
return 'Updates beschikbaar!';
112+
} else {
113+
return 'Geen updates'
114+
}
115+
]]]
116+
label: >
117+
[[[
118+
if(variables.ulm_card_homeassistant_core){
119+
if(states[variables.ulm_card_homeassistant_core].state ==='True'){
120+
var core = 'Core: ' + states[variables.ulm_card_homeassistant_core].attributes.installed_version + ' -> ' + states[variables.ulm_card_homeassistant_core].attributes.latest_version;
121+
} else {
122+
var core = 'Core: ' + states[variables.ulm_card_homeassistant_core].attributes.installed_version;
123+
}
124+
}
125+
if(variables.ulm_card_homeassistant_supervisor){
126+
if(states[variables.ulm_card_homeassistant_supervisor].state ==='True'){
127+
var supervisor = 'Supervisor: ' + states[variables.ulm_card_homeassistant_supervisor].attributes.installed_version + ' -> ' + states[variables.ulm_card_homeassistant_supervisor].attributes.latest_version;
128+
} else {
129+
var supervisor = 'Supervisor: ' + states[variables.ulm_card_homeassistant_supervisor].attributes.installed_version;
130+
}
131+
}
132+
if(variables.ulm_card_homeassistant_os){
133+
if(states[variables.ulm_card_homeassistant_os].state ==='True'){
134+
var os = 'Os: ' + states[variables.ulm_card_homeassistant_os].attributes.installed_version + ' -> ' + states[variables.ulm_card_homeassistant_os].attributes.latest_version;
135+
} else {
136+
var os = 'Os: ' + states[variables.ulm_card_homeassistant_os].attributes.installed_version;
137+
}
138+
}
139+
if(variables.ulm_card_homeassistant_core && variables.ulm_card_homeassistant_supervisor && variables.ulm_card_homeassistant_os){
140+
return supervisor + '<br>' + core + '<br>' + os;
141+
} else if(variables.ulm_card_homeassistant_core && variables.ulm_card_homeassistant_supervisor){
142+
return supervisor + '<br>' + core;
143+
} else if(variables.ulm_card_homeassistant_core){
144+
return core;
145+
}
146+
]]]
147+
styles:
148+
icon:
149+
- color: "rgba(var(--color-theme),0.9)"
150+
item2:
151+
card:
152+
type: "custom:button-card"
153+
template: "list_3_items"
154+
custom_fields:
155+
item1:
156+
card:
157+
type: "custom:button-card"
158+
template: "widget_icon"
159+
icon: "mdi:file-document"
160+
tap_action:
161+
action: url
162+
url_path: https://www.home-assistant.io/latest-release-notes/
163+
item2:
164+
card:
165+
type: "custom:button-card"
166+
template: "widget_icon"
167+
icon: "mdi:cog"
168+
tap_action:
169+
action: navigate
170+
navigation_path: /config/server_control
171+
172+
item3:
173+
card:
174+
type: "custom:button-card"
175+
template: "widget_icon"
176+
icon: "mdi:update"
177+
tap_action:
178+
action: navigate
179+
navigation_path: /config/dashboard
180+
181+
icon_info_updates:
182+
color: var(--google-grey)
183+
show_icon: true
184+
show_label: true
185+
show_name: true
186+
state:
187+
- value: "on"
188+
styles:
189+
custom_fields:
190+
notification:
191+
- border-radius: "50%"
192+
- position: "absolute"
193+
- left: "28px"
194+
- top: "8px"
195+
- height: "16px"
196+
- width: "16px"
197+
- border: "2px solid var(--card-background-color)"
198+
- font-size: "12px"
199+
- line-height: "14px"
200+
- background-color: >
201+
[[[
202+
return "rgba(var(--color-blue),1)";
203+
]]]
204+
icon:
205+
- color: 'rgba(var(--color-blue),1)'
206+
img_cell:
207+
- background-color: 'rgba(var(--color-blue), 0.2)'
208+
styles:
209+
icon:
210+
- color: 'rgba(var(--color-theme),0.2)'
211+
label:
212+
- justify-self: start
213+
- align-self: start
214+
- font-weight: bolder
215+
- font-size: 12px
216+
- filter: opacity(40%)
217+
- margin-left: 16px
218+
- text-align: "start"
219+
name:
220+
- align-self: end
221+
- justify-self: start
222+
- font-weight: bold
223+
- font-size: 14px
224+
- margin-left: 16px
225+
- margin-bottom: 4px
226+
state:
227+
- justify-self: start
228+
- align-self: start
229+
- font-weight: bolder
230+
- font-size: 12px
231+
- filter: opacity(40%)
232+
- margin-left: 12px
233+
img_cell:
234+
- background-color: 'rgba(var(--color-theme),0.05)'
235+
- border-radius: 50%
236+
- place-self: center
237+
- width: 42px
238+
- height: 42px
239+
grid:
240+
- grid-template-areas: '"i n" "i l"'
241+
- grid-template-columns: min-content auto
242+
- grid-template-rows: min-content min-content
243+
card:
244+
- border-radius: 21px 8px 8px 21px
245+
- box-shadow: none
246+
- padding: 0px
247+
# - background-color: 'rgba(var(--color-theme),0)'
248+
custom_fields:
249+
notification: >
250+
[[[
251+
if ( entity.state =="unavailable" || entity.state =="on" ){
252+
return `<ha-icon icon="mdi:party-popper" style="width: 12px; height: 12px; color: var(--primary-background-color);"></ha-icon>`;
253+
}
254+
]]]
255+
size: 20px
256+
257+
```
258+
259+
## Template sensors code
260+
261+
```yaml
262+
- platform: command_line
263+
name: core_updates
264+
command: 'curl http://supervisor/core/info -H "Authorization: Bearer $(printenv SUPERVISOR_TOKEN)" | jq ''{"latest_version":.data.version_latest,"installed_version":.data.version,"update_available":.data.update_available}'''
265+
value_template: '{{ value_json.update_available }}'
266+
scan_interval: 600
267+
json_attributes:
268+
- update_available
269+
- latest_version
270+
- installed_version
271+
272+
- platform: command_line
273+
name: supervisor_updates
274+
command: 'curl http://supervisor/supervisor/info -H "Authorization: Bearer $(printenv SUPERVISOR_TOKEN)" | jq ''{"latest_version":.data.version_latest,"installed_version":.data.version,"update_available":.data.update_available}'''
275+
value_template: '{{ value_json.update_available }}'
276+
scan_interval: 600
277+
json_attributes:
278+
- update_available
279+
- latest_version
280+
- installed_version
281+
282+
- platform: command_line
283+
name: os_updates
284+
command: 'curl http://supervisor/os/info -H "Authorization: Bearer $(printenv SUPERVISOR_TOKEN)" | jq ''{"latest_version":.data.version_latest,"installed_version":.data.version,"update_available":.data.update_available}'''
285+
value_template: '{{ value_json.update_available }}'
286+
scan_interval: 600
287+
json_attributes:
288+
- update_available
289+
- latest_version
290+
- installed_version
291+
```
292+
293+
## Template sensor group.updates
294+
295+
```yaml
296+
group:
297+
updaters:
298+
name: Updates
299+
entities:
300+
- binary_sensor.updater_core
301+
- binary_sensor.updater_supervisor
302+
- binary_sensor.updater_os
303+
```

0 commit comments

Comments
 (0)