mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Support no level on floors (#20206)
This commit is contained in:
parent
b662512995
commit
f5ff55abc5
@ -21,7 +21,7 @@ export interface FloorAreaLookup {
|
|||||||
|
|
||||||
export interface FloorRegistryEntryMutableParams {
|
export interface FloorRegistryEntryMutableParams {
|
||||||
name: string;
|
name: string;
|
||||||
level?: number;
|
level?: number | null;
|
||||||
icon?: string | null;
|
icon?: string | null;
|
||||||
aliases?: string[];
|
aliases?: string[];
|
||||||
}
|
}
|
||||||
@ -34,7 +34,7 @@ const fetchFloorRegistry = (conn: Connection) =>
|
|||||||
.then((floors) =>
|
.then((floors) =>
|
||||||
(floors as FloorRegistryEntry[]).sort((ent1, ent2) => {
|
(floors as FloorRegistryEntry[]).sort((ent1, ent2) => {
|
||||||
if (ent1.level !== ent2.level) {
|
if (ent1.level !== ent2.level) {
|
||||||
return (ent1.level ?? 0) - (ent2.level ?? 0);
|
return (ent1.level ?? 9999) - (ent2.level ?? 9999);
|
||||||
}
|
}
|
||||||
return stringCompare(ent1.name, ent2.name);
|
return stringCompare(ent1.name, ent2.name);
|
||||||
})
|
})
|
||||||
|
@ -24,7 +24,7 @@ class DialogFloorDetail extends LitElement {
|
|||||||
|
|
||||||
@state() private _icon!: string | null;
|
@state() private _icon!: string | null;
|
||||||
|
|
||||||
@state() private _level!: number;
|
@state() private _level!: number | null;
|
||||||
|
|
||||||
@state() private _error?: string;
|
@state() private _error?: string;
|
||||||
|
|
||||||
@ -40,7 +40,7 @@ class DialogFloorDetail extends LitElement {
|
|||||||
this._name = this._params.entry ? this._params.entry.name : "";
|
this._name = this._params.entry ? this._params.entry.name : "";
|
||||||
this._aliases = this._params.entry?.aliases || [];
|
this._aliases = this._params.entry?.aliases || [];
|
||||||
this._icon = this._params.entry?.icon || null;
|
this._icon = this._params.entry?.icon || null;
|
||||||
this._level = this._params.entry?.level ?? 0;
|
this._level = this._params.entry?.level ?? null;
|
||||||
await this.updateComplete;
|
await this.updateComplete;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user