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 GitHub
parent 9557b604da
commit 62f227da83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 8 deletions

View File

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

View File

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

View File

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

View File

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