mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-09 18:36:35 +00:00
Add missing type to create device automation/script heading (#11635)
Co-authored-by: Bram Kragten <mail@bramkragten.nl>
This commit is contained in:
parent
92a9ed7080
commit
b053881cef
@ -60,18 +60,18 @@ export class DialogDeviceAutomation extends LitElement {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const { deviceId, script } = this._params;
|
const { device, script } = this._params;
|
||||||
|
|
||||||
fetchDeviceActions(this.hass, deviceId).then((actions) => {
|
fetchDeviceActions(this.hass, device.id).then((actions) => {
|
||||||
this._actions = actions;
|
this._actions = actions;
|
||||||
});
|
});
|
||||||
if (script) {
|
if (script) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
fetchDeviceTriggers(this.hass, deviceId).then((triggers) => {
|
fetchDeviceTriggers(this.hass, device.id).then((triggers) => {
|
||||||
this._triggers = triggers;
|
this._triggers = triggers;
|
||||||
});
|
});
|
||||||
fetchDeviceConditions(this.hass, deviceId).then((conditions) => {
|
fetchDeviceConditions(this.hass, device.id).then((conditions) => {
|
||||||
this._conditions = conditions;
|
this._conditions = conditions;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -88,7 +88,14 @@ export class DialogDeviceAutomation extends LitElement {
|
|||||||
.heading=${this.hass.localize(
|
.heading=${this.hass.localize(
|
||||||
`ui.panel.config.devices.${
|
`ui.panel.config.devices.${
|
||||||
this._params.script ? "script" : "automation"
|
this._params.script ? "script" : "automation"
|
||||||
}.create`
|
}.create`,
|
||||||
|
{
|
||||||
|
type: this.hass.localize(
|
||||||
|
`ui.panel.config.devices.type.${
|
||||||
|
this._params.device.entry_type || "device"
|
||||||
|
}`
|
||||||
|
),
|
||||||
|
}
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<div @entry-selected=${this.closeDialog}>
|
<div @entry-selected=${this.closeDialog}>
|
||||||
|
@ -1,7 +1,8 @@
|
|||||||
import { fireEvent } from "../../../../common/dom/fire_event";
|
import { fireEvent } from "../../../../common/dom/fire_event";
|
||||||
|
import { DeviceRegistryEntry } from "../../../../data/device_registry";
|
||||||
|
|
||||||
export interface DeviceAutomationDialogParams {
|
export interface DeviceAutomationDialogParams {
|
||||||
deviceId: string;
|
device: DeviceRegistryEntry;
|
||||||
script?: boolean;
|
script?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -812,12 +812,15 @@ export class HaConfigDevicePage extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private _showScriptDialog() {
|
private _showScriptDialog() {
|
||||||
showDeviceAutomationDialog(this, { deviceId: this.deviceId, script: true });
|
showDeviceAutomationDialog(this, {
|
||||||
|
device: this._device(this.deviceId, this.devices)!,
|
||||||
|
script: true,
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private _showAutomationDialog() {
|
private _showAutomationDialog() {
|
||||||
showDeviceAutomationDialog(this, {
|
showDeviceAutomationDialog(this, {
|
||||||
deviceId: this.deviceId,
|
device: this._device(this.deviceId, this.devices)!,
|
||||||
script: false,
|
script: false,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user