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;
|
||||
}
|
||||
|
||||
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;
|
||||
});
|
||||
if (script) {
|
||||
return;
|
||||
}
|
||||
fetchDeviceTriggers(this.hass, deviceId).then((triggers) => {
|
||||
fetchDeviceTriggers(this.hass, device.id).then((triggers) => {
|
||||
this._triggers = triggers;
|
||||
});
|
||||
fetchDeviceConditions(this.hass, deviceId).then((conditions) => {
|
||||
fetchDeviceConditions(this.hass, device.id).then((conditions) => {
|
||||
this._conditions = conditions;
|
||||
});
|
||||
}
|
||||
@ -88,7 +88,14 @@ export class DialogDeviceAutomation extends LitElement {
|
||||
.heading=${this.hass.localize(
|
||||
`ui.panel.config.devices.${
|
||||
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}>
|
||||
|
@ -1,7 +1,8 @@
|
||||
import { fireEvent } from "../../../../common/dom/fire_event";
|
||||
import { DeviceRegistryEntry } from "../../../../data/device_registry";
|
||||
|
||||
export interface DeviceAutomationDialogParams {
|
||||
deviceId: string;
|
||||
device: DeviceRegistryEntry;
|
||||
script?: boolean;
|
||||
}
|
||||
|
||||
|
@ -812,12 +812,15 @@ export class HaConfigDevicePage extends LitElement {
|
||||
}
|
||||
|
||||
private _showScriptDialog() {
|
||||
showDeviceAutomationDialog(this, { deviceId: this.deviceId, script: true });
|
||||
showDeviceAutomationDialog(this, {
|
||||
device: this._device(this.deviceId, this.devices)!,
|
||||
script: true,
|
||||
});
|
||||
}
|
||||
|
||||
private _showAutomationDialog() {
|
||||
showDeviceAutomationDialog(this, {
|
||||
deviceId: this.deviceId,
|
||||
device: this._device(this.deviceId, this.devices)!,
|
||||
script: false,
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user