@@ -113,49 +113,47 @@ updates:
113
113
- settings
114
114
state_display : |
115
115
[[[
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>→</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>←</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>→</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>`;
158
144
}
145
+
146
+ // subtitle
147
+ let count = updates?.attributes.update_entities + updates?.attributes.other_updates,
148
+ subtitle = count === 0
149
+ ? `${no_updates} <b>←</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
+ `;
159
157
]]]
160
158
161
159
updates_icon_name :
0 commit comments