From d97763a3e85020b743becfcf2e754c0cf09f0e9a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20S=C3=B8rensen?= Date: Wed, 20 Apr 2022 15:17:56 +0200 Subject: [PATCH] Add clear skipped to update more-info dialog (#12361) --- .../more-info/controls/more-info-update.ts | 20 +++++++++++++++++-- src/translations/en.json | 1 + 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/dialogs/more-info/controls/more-info-update.ts b/src/dialogs/more-info/controls/more-info-update.ts index e8a2ed89d8..ee855ddb13 100644 --- a/src/dialogs/more-info/controls/more-info-update.ts +++ b/src/dialogs/more-info/controls/more-info-update.ts @@ -21,6 +21,7 @@ import { UPDATE_SUPPORT_SPECIFIC_VERSION, } from "../../../data/update"; import type { HomeAssistant } from "../../../types"; +import { BINARY_STATE_OFF } from "../../../common/const"; @customElement("more-info-update") class MoreInfoUpdate extends LitElement { @@ -129,11 +130,20 @@ class MoreInfoUpdate extends LitElement {
${this.stateObj.attributes.auto_update ? "" + : this.stateObj.state === BINARY_STATE_OFF && + this.stateObj.attributes.skipped_version + ? html` + + ${this.hass.localize( + "ui.dialogs.more_info_control.update.clear_skipped" + )} + + ` : html` ${this.hass.localize( @@ -145,7 +155,7 @@ class MoreInfoUpdate extends LitElement { ? html` @@ -207,6 +217,12 @@ class MoreInfoUpdate extends LitElement { }); } + private _handleClearSkipped(): void { + this.hass.callService("update", "clear_skipped", { + entity_id: this.stateObj!.entity_id, + }); + } + static get styles(): CSSResultGroup { return css` hr { diff --git a/src/translations/en.json b/src/translations/en.json index 9b9be70c02..4e545b1f28 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -735,6 +735,7 @@ "latest_version": "Latest version", "release_announcement": "Read release announcement", "skip": "Skip", + "clear_skipped": "Clear skipped", "install": "Install", "create_backup": "Create backup before updating" },