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>; agent_errors: Record<string, string>;
last_attempted_automatic_backup: string | null; last_attempted_automatic_backup: string | null;
last_completed_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: string | null;
next_automatic_backup_additional: boolean; next_automatic_backup_additional: boolean;
state: BackupManagerState; state: BackupManagerState;

View File

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

View File

@ -91,7 +91,7 @@ class OnboardingRestoreBackup extends LitElement {
.supervisor=${this.supervisor} .supervisor=${this.supervisor}
.error=${this._failed .error=${this._failed
? this.localize( ? 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} : this._error}
@restore-started=${this._restoreStarted} @restore-started=${this._restoreStarted}
@ -157,14 +157,14 @@ class OnboardingRestoreBackup extends LitElement {
} }
const { const {
last_non_idle_event: lastNonIdleEvent, last_action_event: lastActionEvent,
state: currentState, state: currentState,
backups, backups,
} = onboardingInfo; } = onboardingInfo;
this._backupInfo = { this._backupInfo = {
state: currentState, state: currentState,
last_non_idle_event: lastNonIdleEvent, last_action_event: lastActionEvent,
}; };
if (this.mode === "cloud") { if (this.mode === "cloud") {
@ -192,8 +192,8 @@ class OnboardingRestoreBackup extends LitElement {
} }
const failedRestore = const failedRestore =
lastNonIdleEvent?.manager_state === "restore_backup" && lastActionEvent?.manager_state === "restore_backup" &&
lastNonIdleEvent?.state === "failed"; lastActionEvent?.state === "failed";
if (failedRestore) { if (failedRestore) {
this._failed = true; this._failed = true;

View File

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