mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-24 09:46:36 +00:00
Fixes multiple domains target selector in blueprint (#15054)
* Fixes multiple domains target selector in blueprint * Fixes lint
This commit is contained in:
parent
dcedafaef4
commit
45e7f8ae06
@ -9,6 +9,7 @@ import {
|
||||
} from "lit";
|
||||
import { customElement, property, state } from "lit/decorators";
|
||||
import memoizeOne from "memoize-one";
|
||||
import { ensureArray } from "../../common/array/ensure-array";
|
||||
import {
|
||||
DeviceRegistryEntry,
|
||||
getDeviceIntegrationLookup,
|
||||
@ -78,7 +79,7 @@ export class HaTargetSelector extends LitElement {
|
||||
? [this.selector.target?.entity.device_class]
|
||||
: undefined}
|
||||
.includeDomains=${this.selector.target?.entity?.domain
|
||||
? [this.selector.target?.entity.domain]
|
||||
? ensureArray(this.selector.target.entity.domain as string | string[])
|
||||
: undefined}
|
||||
.disabled=${this.disabled}
|
||||
></ha-target-picker>`;
|
||||
|
@ -184,7 +184,7 @@ export class HaBlueprintAutomationEditor extends LitElement {
|
||||
ev.stopPropagation();
|
||||
const target = ev.target as any;
|
||||
const key = target.key;
|
||||
const value = ev.detail?.value ?? target.value;
|
||||
const value = ev.detail ? ev.detail.value : target.value;
|
||||
if (
|
||||
(this.config.use_blueprint.input &&
|
||||
this.config.use_blueprint.input[key] === value) ||
|
||||
|
@ -158,7 +158,7 @@ export class HaBlueprintScriptEditor extends LitElement {
|
||||
ev.stopPropagation();
|
||||
const target = ev.target as any;
|
||||
const key = target.key;
|
||||
const value = ev.detail?.value ?? target.value;
|
||||
const value = ev.detail ? ev.detail.value : target.value;
|
||||
if (
|
||||
(this.config.use_blueprint.input &&
|
||||
this.config.use_blueprint.input[key] === value) ||
|
||||
|
Loading…
x
Reference in New Issue
Block a user