Skip to content

Commit

Permalink
Remove backup toggle on the update more info dialog (#23314)
Browse files Browse the repository at this point in the history
  • Loading branch information
piitaya authored Dec 16, 2024
1 parent 7370d1e commit 0ef23cd
Showing 1 changed file with 0 additions and 34 deletions.
34 changes: 0 additions & 34 deletions src/dialogs/more-info/controls/more-info-update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import "../../../components/ha-faded";
import "../../../components/ha-formfield";
import "../../../components/ha-markdown";
import "../../../components/ha-settings-row";
import "../../../components/ha-switch";
import type { HaSwitch } from "../../../components/ha-switch";
import { isUnavailableState } from "../../../data/entity";
import type { UpdateEntity } from "../../../data/update";
import {
Expand Down Expand Up @@ -136,21 +134,6 @@ class MoreInfoUpdate extends LitElement {
: nothing}
</div>
<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">
${this.stateObj.state === BINARY_STATE_OFF &&
this.stateObj.attributes.skipped_version
Expand Down Expand Up @@ -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 {
const installData: Record<string, any> = {
entity_id: this.stateObj!.entity_id,
};

if (this._shouldCreateBackup) {
installData.backup = true;
}

if (
supportsFeature(this.stateObj!, UpdateEntityFeature.SPECIFIC_VERSION) &&
this.stateObj!.attributes.latest_version
Expand Down

0 comments on commit 0ef23cd

Please sign in to comment.