Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple backup adjustments #23361

Merged
merged 10 commits into from
Dec 20, 2024
Prev Previous commit
Next Next commit
Rename copies to backups, drop 7 days
piitaya committed Dec 20, 2024
commit ce15258225d535c3d8784b153a05d959fdf13b9c
Original file line number Diff line number Diff line change
@@ -23,7 +23,6 @@ const MAX_VALUE = 50;

enum RetentionPreset {
COPIES_3 = "copies_3",
DAYS_7 = "days_7",
FOREVER = "forever",
CUSTOM = "custom",
}
@@ -38,7 +37,6 @@ const RETENTION_PRESETS: Record<
RetentionData
> = {
copies_3: { type: "copies", value: 3 },
days_7: { type: "days", value: 7 },
forever: { type: "days", value: 0 },
};

@@ -176,7 +174,7 @@ class HaBackupConfigSchedule extends LitElement {
</ha-md-select>
</ha-md-list-item>
<ha-md-list-item>
<span slot="headline">Maximum copies</span>
<span slot="headline">Backups to keep</span>
<span slot="supporting-text">
The number of backups that are saved
</span>
@@ -186,13 +184,10 @@ class HaBackupConfigSchedule extends LitElement {
.value=${this._retentionPreset}
>
<ha-md-select-option .value=${RetentionPreset.COPIES_3}>
<div slot="headline">Latest 3 copies</div>
</ha-md-select-option>
<ha-md-select-option .value=${RetentionPreset.DAYS_7}>
<div slot="headline">Keep 7 days</div>
<div slot="headline">3 backups</div>
</ha-md-select-option>
<ha-md-select-option .value=${RetentionPreset.FOREVER}>
<div slot="headline">Keep forever</div>
<div slot="headline">All backups</div>
</ha-md-select-option>
<ha-md-select-option .value=${RetentionPreset.CUSTOM}>
<div slot="headline">Custom</div>
@@ -223,7 +218,7 @@ class HaBackupConfigSchedule extends LitElement {
<div slot="headline">days</div>
</ha-md-select-option>
<ha-md-select-option .value=${"copies"}>
<div slot="headline">copies</div>
<div slot="headline">backups</div>
</ha-md-select-option>
</ha-md-select>
</ha-md-list-item>
Original file line number Diff line number Diff line change
@@ -38,7 +38,7 @@ class HaBackupOverviewBackups extends LitElement {
Backups are essential to a reliable smart home. They protect your
setup against failures and allows you to quickly have a working
system again. It is recommended to create a daily backup and keep
copies of the last 3 days on two different locations. And one of
backups of the last 3 days on two different locations. And one of
them is off-site.
</p>
</div>
Original file line number Diff line number Diff line change
@@ -33,7 +33,7 @@ class HaBackupBackupsSummary extends LitElement {

let copiesText = "and keep all backups";
if (copies) {
copiesText = `and keep the latest ${copies} copie(s)`;
copiesText = `and keep the latest ${copies} backup(s)`;
} else if (days) {
copiesText = `and keep backups for ${days} day(s)`;
}
6 changes: 3 additions & 3 deletions src/panels/config/backup/dialogs/dialog-backup-onboarding.ts
Original file line number Diff line number Diff line change
@@ -284,7 +284,7 @@ class DialogBackupOnboarding extends LitElement implements HassDialog {
Backups are essential to a reliable smart home. They protect your
setup against failures and allows you to quickly have a working
system again. It is recommended to create a daily backup and keep
copies of the last 3 days on two different locations. And one of
backups of the last 3 days on two different locations. And one of
them is off-site.
</p>
</div>
@@ -319,7 +319,7 @@ class DialogBackupOnboarding extends LitElement implements HassDialog {
case "setup":
return html`
<p>
It is recommended to create a daily backup and keep copies of the
It is recommended to create a daily backup and keep backups of the
last 3 days on two different locations. And one of them is off-site.
</p>
<ha-md-list class="full">
@@ -343,7 +343,7 @@ class DialogBackupOnboarding extends LitElement implements HassDialog {
return html`
<p>
Let Home Assistant take care of your backups by creating a scheduled
backup that also removes older copies.
backup that also removes older backups.
</p>
<ha-backup-config-schedule
.hass=${this.hass}
2 changes: 1 addition & 1 deletion src/panels/config/backup/ha-config-backup-settings.ts
Original file line number Diff line number Diff line change
@@ -56,7 +56,7 @@ class HaConfigBackupSettings extends LitElement {
<div class="card-content">
<p>
Let Home Assistant take care of your backups by creating a
scheduled backup that also removes older copies.
scheduled backup that also removes older backups.
</p>
<ha-backup-config-schedule
.hass=${this.hass}