Rename last_non_idle_event to last_action_event (#24691)

This commit is contained in:
Wendelin 2025-03-19 17:28:44 +01:00 committed by GitHub
parent 27379c98df
commit 0e8be25a60
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 9 additions and 9 deletions

View File

@ -136,7 +136,7 @@ export interface BackupInfo {
agent_errors: Record<string, string>;
last_attempted_automatic_backup: string | null;
last_completed_automatic_backup: string | null;
last_non_idle_event: ManagerStateEvent | null;
last_action_event: ManagerStateEvent | null;
next_automatic_backup: string | null;
next_automatic_backup_additional: boolean;
state: BackupManagerState;

View File

@ -8,7 +8,7 @@ import type {
export interface BackupOnboardingInfo {
state: BackupManagerState;
last_non_idle_event?: {
last_action_event?: {
manager_state: BackupManagerState;
stage: RestoreBackupStage | null;
state: RestoreBackupState;

View File

@ -91,7 +91,7 @@ class OnboardingRestoreBackup extends LitElement {
.supervisor=${this.supervisor}
.error=${this._failed
? this.localize(
`ui.panel.page-onboarding.restore.${this._backupInfo?.last_non_idle_event?.reason === "password_incorrect" ? "failed_wrong_password_description" : "failed_description"}`
`ui.panel.page-onboarding.restore.${this._backupInfo?.last_action_event?.reason === "password_incorrect" ? "failed_wrong_password_description" : "failed_description"}`
)
: this._error}
@restore-started=${this._restoreStarted}
@ -157,14 +157,14 @@ class OnboardingRestoreBackup extends LitElement {
}
const {
last_non_idle_event: lastNonIdleEvent,
last_action_event: lastActionEvent,
state: currentState,
backups,
} = onboardingInfo;
this._backupInfo = {
state: currentState,
last_non_idle_event: lastNonIdleEvent,
last_action_event: lastActionEvent,
};
if (this.mode === "cloud") {
@ -192,8 +192,8 @@ class OnboardingRestoreBackup extends LitElement {
}
const failedRestore =
lastNonIdleEvent?.manager_state === "restore_backup" &&
lastNonIdleEvent?.state === "failed";
lastActionEvent?.manager_state === "restore_backup" &&
lastActionEvent?.state === "failed";
if (failedRestore) {
this._failed = true;

View File

@ -42,11 +42,11 @@ class OnboardingRestoreBackupStatus extends LitElement {
"ui.panel.page-onboarding.restore.failed_status_description"
)}
</ha-alert>
${this.backupInfo.last_non_idle_event?.reason
${this.backupInfo.last_action_event?.reason
? html`
<div class="failed">
<h4>Error:</h4>
${this.backupInfo.last_non_idle_event?.reason}
${this.backupInfo.last_action_event?.reason}
</div>
`
: nothing}