Skip to content

Commit dbfed2f

Browse files
committed
rm restored test entity
1 parent 9db30d3 commit dbfed2f

File tree

2 files changed

+40
-43
lines changed

2 files changed

+40
-43
lines changed

button_card_templates/updates.yaml

Lines changed: 40 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -113,49 +113,47 @@ updates:
113113
- settings
114114
state_display: |
115115
[[[
116-
if (entity) {
117-
// variables
118-
let output = '',
119-
updates = states[variables.updates],
120-
hacs_installed = states[variables.hacs_installed]?.attributes.repositories,
121-
other_updates = states[variables.other_updates],
122-
hacs_update = states['update.hacs_update']?.attributes.installed_version,
123-
no_updates = variables.translate_no_updates,
124-
update_available = variables.translate_update_available,
125-
updates_available = variables.translate_updates_available;
126-
127-
// update entities
128-
Object.keys(states).forEach(key => {
129-
let s = states[key], e = s.entity_id, a = s.attributes;
130-
if (e.includes('update.') && s.state === 'on') {
131-
let rename_hacs = `${a.release_url.split('/')[3]}/${a.release_url.split('/')[4]}`,
132-
name = hacs_installed.includes(rename_hacs)
133-
? rename_hacs
134-
: a.friendly_name;
135-
output += `<li><b><a href="#" onclick="window.open('${a.release_url}');">
136-
${name}</a></b> ${a.installed_version} <b>&rarr;</b> ${a.latest_version}</li>`
137-
}
138-
});
139-
140-
// other updates
141-
let attr = Object.fromEntries(
142-
Object.entries(other_updates?.attributes).filter(([, value]) => value != false));
143-
for (const [, value] of Object.entries(attr)) {
144-
output += `<li>${value}</li>`;
145-
}
146-
147-
// subtitle
148-
let count = updates?.attributes.update_entities + updates?.attributes.other_updates,
149-
subtitle = count === 0
150-
? `${no_updates} <b>&larr;</b> ${hacs_update || ''}`
151-
: `${count} ${count === 1 ? update_available : updates_available} ${String.fromCodePoint('0x1f389')}`;
152-
153-
return `
154-
<ha-icon icon="mdi:package-up"></ha-icon> <span class="title">Integrationer</span><br>
155-
<p class="subtitle">${subtitle}</p>
156-
<ul>${output}</ul>
157-
`;
116+
// variables
117+
let output = '',
118+
updates = states[variables.updates],
119+
hacs_installed = states[variables.hacs_installed]?.attributes.repositories,
120+
other_updates = states[variables.other_updates],
121+
hacs_update = states['update.hacs_update']?.attributes.installed_version,
122+
no_updates = variables.translate_no_updates,
123+
update_available = variables.translate_update_available,
124+
updates_available = variables.translate_updates_available;
125+
126+
// update entities
127+
Object.keys(states).forEach(key => {
128+
let s = states[key], e = s.entity_id, a = s.attributes;
129+
if (e.includes('update.') && s.state === 'on') {
130+
let rename_hacs = `${a.release_url.split('/')[3]}/${a.release_url.split('/')[4]}`,
131+
name = hacs_installed.includes(rename_hacs)
132+
? rename_hacs
133+
: a.friendly_name;
134+
output += `<li><b><a href="#" onclick="window.open('${a.release_url}');">
135+
${name}</a></b> ${a.installed_version} <b>&rarr;</b> ${a.latest_version}</li>`
136+
}
137+
});
138+
139+
// other updates
140+
let attr = Object.fromEntries(
141+
Object.entries(other_updates?.attributes).filter(([, value]) => value != false));
142+
for (const [, value] of Object.entries(attr)) {
143+
output += `<li>${value}</li>`;
158144
}
145+
146+
// subtitle
147+
let count = updates?.attributes.update_entities + updates?.attributes.other_updates,
148+
subtitle = count === 0
149+
? `${no_updates} <b>&larr;</b> ${hacs_update || ''}`
150+
: `${count} ${count === 1 ? update_available : updates_available} ${String.fromCodePoint('0x1f389')}`;
151+
152+
return `
153+
<ha-icon icon="mdi:package-up"></ha-icon> <span class="title">Integrationer</span><br>
154+
<p class="subtitle">${subtitle}</p>
155+
<ul>${output}</ul>
156+
`;
159157
]]]
160158
161159
updates_icon_name:

popup/footer_updates.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,6 @@ browser_mod:
6060
############################################
6161

6262
- type: custom:button-card
63-
entity: sensor.template_updates_available
6463
variables:
6564
updates: sensor.template_updates
6665
other_updates: sensor.template_other_updates

0 commit comments

Comments
 (0)