mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-22 16:56:35 +00:00
Remove backup toggle on the update more info dialog (#23314)
This commit is contained in:
parent
7370d1e0dd
commit
0ef23cd712
@ -12,8 +12,6 @@ import "../../../components/ha-faded";
|
|||||||
import "../../../components/ha-formfield";
|
import "../../../components/ha-formfield";
|
||||||
import "../../../components/ha-markdown";
|
import "../../../components/ha-markdown";
|
||||||
import "../../../components/ha-settings-row";
|
import "../../../components/ha-settings-row";
|
||||||
import "../../../components/ha-switch";
|
|
||||||
import type { HaSwitch } from "../../../components/ha-switch";
|
|
||||||
import { isUnavailableState } from "../../../data/entity";
|
import { isUnavailableState } from "../../../data/entity";
|
||||||
import type { UpdateEntity } from "../../../data/update";
|
import type { UpdateEntity } from "../../../data/update";
|
||||||
import {
|
import {
|
||||||
@ -136,21 +134,6 @@ class MoreInfoUpdate extends LitElement {
|
|||||||
: nothing}
|
: nothing}
|
||||||
</div>
|
</div>
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
${supportsFeature(this.stateObj, UpdateEntityFeature.BACKUP)
|
|
||||||
? html`
|
|
||||||
<ha-settings-row>
|
|
||||||
<span slot="heading">
|
|
||||||
${this.hass.localize(
|
|
||||||
"ui.dialogs.more_info_control.update.create_backup"
|
|
||||||
)}
|
|
||||||
</span>
|
|
||||||
<ha-switch
|
|
||||||
id="create-backup"
|
|
||||||
.disabled=${updateIsInstalling(this.stateObj)}
|
|
||||||
></ha-switch>
|
|
||||||
</ha-settings-row>
|
|
||||||
`
|
|
||||||
: nothing}
|
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
${this.stateObj.state === BINARY_STATE_OFF &&
|
${this.stateObj.state === BINARY_STATE_OFF &&
|
||||||
this.stateObj.attributes.skipped_version
|
this.stateObj.attributes.skipped_version
|
||||||
@ -223,28 +206,11 @@ class MoreInfoUpdate extends LitElement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
get _shouldCreateBackup(): boolean | null {
|
|
||||||
if (!supportsFeature(this.stateObj!, UpdateEntityFeature.BACKUP)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
const createBackupSwitch = this.shadowRoot?.getElementById(
|
|
||||||
"create-backup"
|
|
||||||
) as HaSwitch;
|
|
||||||
if (createBackupSwitch) {
|
|
||||||
return createBackupSwitch.checked;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private _handleInstall(): void {
|
private _handleInstall(): void {
|
||||||
const installData: Record<string, any> = {
|
const installData: Record<string, any> = {
|
||||||
entity_id: this.stateObj!.entity_id,
|
entity_id: this.stateObj!.entity_id,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (this._shouldCreateBackup) {
|
|
||||||
installData.backup = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (
|
if (
|
||||||
supportsFeature(this.stateObj!, UpdateEntityFeature.SPECIFIC_VERSION) &&
|
supportsFeature(this.stateObj!, UpdateEntityFeature.SPECIFIC_VERSION) &&
|
||||||
this.stateObj!.attributes.latest_version
|
this.stateObj!.attributes.latest_version
|
||||||
|
Loading…
x
Reference in New Issue
Block a user