Use installed_version for update entities (#12194)

This commit is contained in:
Joakim Sørensen 2022-04-01 19:28:39 +02:00 committed by Bram Kragten
parent 1f65193a97
commit 8e962fdecb
No known key found for this signature in database
GPG Key ID: FBE2DFDB363EF55B
4 changed files with 8 additions and 8 deletions

View File

@ -18,7 +18,7 @@ import { LONG_TEXT } from "../../data/text";
const base_attributes = { const base_attributes = {
title: "Awesome", title: "Awesome",
current_version: "1.2.2", installed_version: "1.2.2",
latest_version: "1.2.3", latest_version: "1.2.3",
release_url: "https://home-assistant.io", release_url: "https://home-assistant.io",
supported_features: UPDATE_SUPPORT_INSTALL, supported_features: UPDATE_SUPPORT_INSTALL,
@ -50,7 +50,7 @@ const ENTITIES = [
}), }),
getEntity("update", "update5", "off", { getEntity("update", "update5", "off", {
...base_attributes, ...base_attributes,
current_version: "1.2.3", installed_version: "1.2.3",
friendly_name: "No update", friendly_name: "No update",
}), }),
getEntity("update", "update6", "off", { getEntity("update", "update6", "off", {
@ -102,8 +102,8 @@ const ENTITIES = [
}), }),
getEntity("update", "update14", "off", { getEntity("update", "update14", "off", {
...base_attributes, ...base_attributes,
current_version: null, installed_version: null,
friendly_name: "Update without current_version", friendly_name: "Update without installed_version",
}), }),
getEntity("update", "update15", "off", { getEntity("update", "update15", "off", {
...base_attributes, ...base_attributes,

View File

@ -14,7 +14,7 @@ export const UPDATE_SUPPORT_RELEASE_NOTES = 16;
interface UpdateEntityAttributes extends HassEntityAttributeBase { interface UpdateEntityAttributes extends HassEntityAttributeBase {
auto_update: boolean | null; auto_update: boolean | null;
current_version: string | null; installed_version: string | null;
in_progress: boolean | number; in_progress: boolean | number;
latest_version: string | null; latest_version: string | null;
release_summary: string | null; release_summary: string | null;

View File

@ -66,11 +66,11 @@ class MoreInfoUpdate extends LitElement {
<div class="row"> <div class="row">
<div class="key"> <div class="key">
${this.hass.localize( ${this.hass.localize(
"ui.dialogs.more_info_control.update.current_version" "ui.dialogs.more_info_control.update.installed_version"
)} )}
</div> </div>
<div class="value"> <div class="value">
${this.stateObj.attributes.current_version ?? ${this.stateObj.attributes.installed_version ??
this.hass.localize("state.default.unavailable")} this.hass.localize("state.default.unavailable")}
</div> </div>
</div> </div>

View File

@ -731,7 +731,7 @@
"setting": "Setting" "setting": "Setting"
}, },
"update": { "update": {
"current_version": "Current version", "installed_version": "Installed version",
"latest_version": "Latest version", "latest_version": "Latest version",
"release_announcement": "Read release announcement", "release_announcement": "Read release announcement",
"skip": "Skip", "skip": "Skip",