Skip to content

Commit d1fd5ce

Browse files
authored
Merge pull request #337 from UI-Lovelace-Minimalist/dev
0.0.5
2 parents 3013d63 + 7d37efe commit d1fd5ce

File tree

214 files changed

+7992
-903
lines changed

Some content is hidden

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

214 files changed

+7992
-903
lines changed

.devcontainer/configuration.yaml

+8-15
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

+11-11
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

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

0 commit comments

Comments
 (0)