From 5c1a8029bfb7e2bdd8511ff775bdb81caa2c5d92 Mon Sep 17 00:00:00 2001 From: karwosts <32912880+karwosts@users.noreply.github.com> Date: Wed, 25 Jun 2025 06:11:23 -0700 Subject: [PATCH] Fix entity selector slicing value on load (#25854) --- src/components/ha-selector/ha-selector-area.ts | 2 +- src/components/ha-selector/ha-selector-device.ts | 2 +- src/components/ha-selector/ha-selector-entity.ts | 2 +- src/components/ha-selector/ha-selector-floor.ts | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/ha-selector/ha-selector-area.ts b/src/components/ha-selector/ha-selector-area.ts index 1966214ab3..d2abf64449 100644 --- a/src/components/ha-selector/ha-selector-area.ts +++ b/src/components/ha-selector/ha-selector-area.ts @@ -54,7 +54,7 @@ export class HaAreaSelector extends LitElement { } protected willUpdate(changedProperties: PropertyValues): void { - if (changedProperties.has("selector") && this.value !== undefined) { + if (changedProperties.get("selector") && this.value !== undefined) { if (this.selector.area?.multiple && !Array.isArray(this.value)) { this.value = [this.value]; fireEvent(this, "value-changed", { value: this.value }); diff --git a/src/components/ha-selector/ha-selector-device.ts b/src/components/ha-selector/ha-selector-device.ts index 0ae3ca0fc6..8ce9b26860 100644 --- a/src/components/ha-selector/ha-selector-device.ts +++ b/src/components/ha-selector/ha-selector-device.ts @@ -56,7 +56,7 @@ export class HaDeviceSelector extends LitElement { } protected willUpdate(changedProperties: PropertyValues): void { - if (changedProperties.has("selector") && this.value !== undefined) { + if (changedProperties.get("selector") && this.value !== undefined) { if (this.selector.device?.multiple && !Array.isArray(this.value)) { this.value = [this.value]; fireEvent(this, "value-changed", { value: this.value }); diff --git a/src/components/ha-selector/ha-selector-entity.ts b/src/components/ha-selector/ha-selector-entity.ts index df3a7eab76..fb9a2eeae1 100644 --- a/src/components/ha-selector/ha-selector-entity.ts +++ b/src/components/ha-selector/ha-selector-entity.ts @@ -43,7 +43,7 @@ export class HaEntitySelector extends LitElement { } protected willUpdate(changedProperties: PropertyValues): void { - if (changedProperties.has("selector") && this.value !== undefined) { + if (changedProperties.get("selector") && this.value !== undefined) { if (this.selector.entity?.multiple && !Array.isArray(this.value)) { this.value = [this.value]; fireEvent(this, "value-changed", { value: this.value }); diff --git a/src/components/ha-selector/ha-selector-floor.ts b/src/components/ha-selector/ha-selector-floor.ts index f756a77426..f7135c2158 100644 --- a/src/components/ha-selector/ha-selector-floor.ts +++ b/src/components/ha-selector/ha-selector-floor.ts @@ -54,7 +54,7 @@ export class HaFloorSelector extends LitElement { } protected willUpdate(changedProperties: PropertyValues): void { - if (changedProperties.has("selector") && this.value !== undefined) { + if (changedProperties.get("selector") && this.value !== undefined) { if (this.selector.floor?.multiple && !Array.isArray(this.value)) { this.value = [this.value]; fireEvent(this, "value-changed", { value: this.value });