From 8baa0b2a9bd50017ad15b47f2ca4d03ebf136410 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Fri, 1 Apr 2022 14:37:47 +0200 Subject: [PATCH] Hide skip when auto_update is true for updates (#12184) --- gallery/src/pages/more-info/update.ts | 5 +++++ src/data/update.ts | 1 + .../more-info/controls/more-info-update.ts | 22 ++++++++++++------- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/gallery/src/pages/more-info/update.ts b/gallery/src/pages/more-info/update.ts index f23ae25780..ea531adc56 100644 --- a/gallery/src/pages/more-info/update.ts +++ b/gallery/src/pages/more-info/update.ts @@ -128,6 +128,11 @@ const ENTITIES = [ supported_features: base_attributes.supported_features + UPDATE_SUPPORT_RELEASE_NOTES, }), + getEntity("update", "update19", "on", { + ...base_attributes, + friendly_name: "Update with auto update", + auto_update: true, + }), ]; @customElement("demo-more-info-update") diff --git a/src/data/update.ts b/src/data/update.ts index 9f913111fe..f6f06da0dc 100644 --- a/src/data/update.ts +++ b/src/data/update.ts @@ -13,6 +13,7 @@ export const UPDATE_SUPPORT_BACKUP = 8; export const UPDATE_SUPPORT_RELEASE_NOTES = 16; interface UpdateEntityAttributes extends HassEntityAttributeBase { + auto_update: boolean | null; current_version: string | null; in_progress: boolean | number; latest_version: string | null; diff --git a/src/dialogs/more-info/controls/more-info-update.ts b/src/dialogs/more-info/controls/more-info-update.ts index 44d3d84840..8fe18779b2 100644 --- a/src/dialogs/more-info/controls/more-info-update.ts +++ b/src/dialogs/more-info/controls/more-info-update.ts @@ -130,14 +130,20 @@ class MoreInfoUpdate extends LitElement { : ""}
- - ${this.hass.localize("ui.dialogs.more_info_control.update.skip")} - + ${this.stateObj.attributes.auto_update + ? "" + : html` + + ${this.hass.localize( + "ui.dialogs.more_info_control.update.skip" + )} + + `} ${supportsFeature(this.stateObj, UPDATE_SUPPORT_INSTALL) ? html`