mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-19 07:16:39 +00:00
Fix clearing device in device action (#11594)
This commit is contained in:
parent
09d46dac61
commit
e9ec2da917
@ -107,6 +107,11 @@ export class HaDeviceAction extends LitElement {
|
||||
private _devicePicked(ev) {
|
||||
ev.stopPropagation();
|
||||
this._deviceId = ev.target.value;
|
||||
if (this._deviceId === undefined) {
|
||||
fireEvent(this, "value-changed", {
|
||||
value: HaDeviceAction.defaultConfig,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private _deviceActionPicked(ev) {
|
||||
|
@ -111,6 +111,11 @@ export class HaDeviceCondition extends LitElement {
|
||||
private _devicePicked(ev) {
|
||||
ev.stopPropagation();
|
||||
this._deviceId = ev.target.value;
|
||||
if (this._deviceId === undefined) {
|
||||
fireEvent(this, "value-changed", {
|
||||
value: { ...HaDeviceCondition.defaultConfig, condition: "device" },
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private _deviceConditionPicked(ev) {
|
||||
|
@ -111,6 +111,11 @@ export class HaDeviceTrigger extends LitElement {
|
||||
private _devicePicked(ev) {
|
||||
ev.stopPropagation();
|
||||
this._deviceId = ev.target.value;
|
||||
if (this._deviceId === undefined) {
|
||||
fireEvent(this, "value-changed", {
|
||||
value: { ...HaDeviceTrigger.defaultConfig, platform: "device" },
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
private _deviceTriggerPicked(ev) {
|
||||
|
@ -400,7 +400,7 @@ class HaPanelDevState extends EventsMixin(LocalizeMixin(PolymerElement)) {
|
||||
}
|
||||
|
||||
entityIdChanged() {
|
||||
if (this._entityId === "") {
|
||||
if (!this._entityId) {
|
||||
this._entity = undefined;
|
||||
this._state = "";
|
||||
this._stateAttributes = "";
|
||||
|
Loading…
x
Reference in New Issue
Block a user