${this._renderPanels(beforeSpacer, selectedPanel)}
-
- ${this._renderSpacer()}${this._renderHiddenPanels()}
- `;
- }
-
private _renderHiddenPanels() {
return html`${this._hiddenPanels.length
? html`${this._hiddenPanels.map((url) => {
diff --git a/src/dialogs/config-flow/step-flow-create-entry.ts b/src/dialogs/config-flow/step-flow-create-entry.ts
index 327b5b783a..eac44ccff9 100644
--- a/src/dialogs/config-flow/step-flow-create-entry.ts
+++ b/src/dialogs/config-flow/step-flow-create-entry.ts
@@ -316,6 +316,12 @@ class StepFlowCreateEntry extends LitElement {
overflow-y: auto;
flex-direction: column;
}
+ @media all and (max-width: 450px), all and (max-height: 500px) {
+ .devices {
+ /* header - margin content - footer */
+ max-height: calc(100vh - 52px - 20px - 52px);
+ }
+ }
.device {
border: 1px solid var(--divider-color);
padding: 6px;
@@ -352,11 +358,6 @@ class StepFlowCreateEntry extends LitElement {
margin-inline-start: auto;
margin-inline-end: initial;
}
- @media all and (max-width: 450px), all and (max-height: 500px) {
- .device {
- width: 100%;
- }
- }
.error {
color: var(--error-color);
}
diff --git a/src/panels/config/backup/components/config/ha-backup-config-agents.ts b/src/panels/config/backup/components/config/ha-backup-config-agents.ts
index f808d3fe99..686d6bd0a5 100644
--- a/src/panels/config/backup/components/config/ha-backup-config-agents.ts
+++ b/src/panels/config/backup/components/config/ha-backup-config-agents.ts
@@ -31,7 +31,7 @@ const DEFAULT_AGENTS = [];
class HaBackupConfigAgents extends LitElement {
@property({ attribute: false }) public hass!: HomeAssistant;
- @property({ attribute: false }) public cloudStatus!: CloudStatus;
+ @property({ attribute: false }) public cloudStatus?: CloudStatus;
@property({ attribute: false }) public agents: BackupAgent[] = [];
@@ -48,7 +48,10 @@ class HaBackupConfigAgents extends LitElement {
private _description(agentId: string) {
if (agentId === CLOUD_AGENT) {
- if (this.cloudStatus.logged_in && !this.cloudStatus.active_subscription) {
+ if (
+ this.cloudStatus?.logged_in &&
+ !this.cloudStatus.active_subscription
+ ) {
return this.hass.localize(
"ui.panel.config.backup.agents.cloud_agent_no_subcription"
);
@@ -106,17 +109,17 @@ class HaBackupConfigAgents extends LitElement {
}
private _availableAgents = memoizeOne(
- (agents: BackupAgent[], cloudStatus: CloudStatus) =>
+ (agents: BackupAgent[], cloudStatus?: CloudStatus) =>
agents.filter(
- (agent) => agent.agent_id !== CLOUD_AGENT || cloudStatus.logged_in
+ (agent) => agent.agent_id !== CLOUD_AGENT || cloudStatus?.logged_in
)
);
private _unavailableAgents = memoizeOne(
(
agents: BackupAgent[],
- cloudStatus: CloudStatus,
- selectedAgentIds: string[]
+ selectedAgentIds: string[],
+ cloudStatus?: CloudStatus
) => {
const availableAgentIds = this._availableAgents(agents, cloudStatus).map(
(agent) => agent.agent_id
@@ -167,8 +170,8 @@ class HaBackupConfigAgents extends LitElement {
);
const unavailableAgents = this._unavailableAgents(
this.agents,
- this.cloudStatus,
- this._value
+ this._value,
+ this.cloudStatus
);
const allAgents = [...availableAgents, ...unavailableAgents];
@@ -187,7 +190,7 @@ class HaBackupConfigAgents extends LitElement {
const description = this._description(agentId);
const noCloudSubscription =
agentId === CLOUD_AGENT &&
- this.cloudStatus.logged_in &&
+ this.cloudStatus?.logged_in &&
!this.cloudStatus.active_subscription;
return html`
diff --git a/src/panels/config/backup/components/config/ha-backup-config-retention.ts b/src/panels/config/backup/components/config/ha-backup-config-retention.ts
index 245f700600..05b0564eb0 100644
--- a/src/panels/config/backup/components/config/ha-backup-config-retention.ts
+++ b/src/panels/config/backup/components/config/ha-backup-config-retention.ts
@@ -1,5 +1,5 @@
-import { css, html, LitElement, nothing, type PropertyValues } from "lit";
-import { customElement, property, state } from "lit/decorators";
+import { css, html, LitElement, nothing } from "lit";
+import { customElement, property, query, state } from "lit/decorators";
import { fireEvent } from "../../../../../common/dom/fire_event";
import { clamp } from "../../../../../common/number/clamp";
import "../../../../../components/ha-expansion-panel";
@@ -8,6 +8,7 @@ import "../../../../../components/ha-md-select";
import type { HaMdSelect } from "../../../../../components/ha-md-select";
import "../../../../../components/ha-md-select-option";
import "../../../../../components/ha-md-textfield";
+import type { HaMdTextfield } from "../../../../../components/ha-md-textfield";
import type { BackupConfig, Retention } from "../../../../../data/backup";
import type { HomeAssistant } from "../../../../../types";
@@ -54,16 +55,21 @@ class HaBackupConfigRetention extends LitElement {
@state() private _value = 3;
+ @query("#value") private _customValueField?: HaMdTextfield;
+
+ @query("#type") private _customTypeField?: HaMdSelect;
+
+ private _configLoaded = false;
+
private presetOptions = [
RetentionPreset.COPIES_3,
RetentionPreset.FOREVER,
RetentionPreset.CUSTOM,
];
- public willUpdate(properties: PropertyValues) {
- super.willUpdate(properties);
-
- if (!this.hasUpdated) {
+ public willUpdate() {
+ if (!this._configLoaded && this.retention !== undefined) {
+ this._configLoaded = true;
if (!this.retention) {
this._preset = RetentionPreset.GLOBAL;
} else if (
@@ -94,6 +100,10 @@ class HaBackupConfigRetention extends LitElement {
}
protected render() {
+ if (!this._configLoaded) {
+ return nothing;
+ }
+
return html`