mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +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";
|
} from "lit";
|
||||||
import { customElement, property, state } from "lit/decorators";
|
import { customElement, property, state } from "lit/decorators";
|
||||||
import memoizeOne from "memoize-one";
|
import memoizeOne from "memoize-one";
|
||||||
|
import { ensureArray } from "../../common/array/ensure-array";
|
||||||
import {
|
import {
|
||||||
DeviceRegistryEntry,
|
DeviceRegistryEntry,
|
||||||
getDeviceIntegrationLookup,
|
getDeviceIntegrationLookup,
|
||||||
@ -78,7 +79,7 @@ export class HaTargetSelector extends LitElement {
|
|||||||
? [this.selector.target?.entity.device_class]
|
? [this.selector.target?.entity.device_class]
|
||||||
: undefined}
|
: undefined}
|
||||||
.includeDomains=${this.selector.target?.entity?.domain
|
.includeDomains=${this.selector.target?.entity?.domain
|
||||||
? [this.selector.target?.entity.domain]
|
? ensureArray(this.selector.target.entity.domain as string | string[])
|
||||||
: undefined}
|
: undefined}
|
||||||
.disabled=${this.disabled}
|
.disabled=${this.disabled}
|
||||||
></ha-target-picker>`;
|
></ha-target-picker>`;
|
||||||
|
@ -184,7 +184,7 @@ export class HaBlueprintAutomationEditor extends LitElement {
|
|||||||
ev.stopPropagation();
|
ev.stopPropagation();
|
||||||
const target = ev.target as any;
|
const target = ev.target as any;
|
||||||
const key = target.key;
|
const key = target.key;
|
||||||
const value = ev.detail?.value ?? target.value;
|
const value = ev.detail ? ev.detail.value : target.value;
|
||||||
if (
|
if (
|
||||||
(this.config.use_blueprint.input &&
|
(this.config.use_blueprint.input &&
|
||||||
this.config.use_blueprint.input[key] === value) ||
|
this.config.use_blueprint.input[key] === value) ||
|
||||||
|
@ -158,7 +158,7 @@ export class HaBlueprintScriptEditor extends LitElement {
|
|||||||
ev.stopPropagation();
|
ev.stopPropagation();
|
||||||
const target = ev.target as any;
|
const target = ev.target as any;
|
||||||
const key = target.key;
|
const key = target.key;
|
||||||
const value = ev.detail?.value ?? target.value;
|
const value = ev.detail ? ev.detail.value : target.value;
|
||||||
if (
|
if (
|
||||||
(this.config.use_blueprint.input &&
|
(this.config.use_blueprint.input &&
|
||||||
this.config.use_blueprint.input[key] === value) ||
|
this.config.use_blueprint.input[key] === value) ||
|
||||||
|
Loading…
x
Reference in New Issue
Block a user