-
- ${
- isComponentLoaded(this.hass, "automation")
- ? html`
-
-
- ${this._related?.automation?.length
- ? html`
-
- ${this._related.automation.map((automation) => {
- const entityState =
- this.hass.states[automation];
- return entityState
- ? html`
`
- : "";
- })}
-
- `
- : html`
-
- ${this.hass.localize(
- "ui.panel.config.devices.add_prompt",
- "name",
- this.hass.localize(
- "ui.panel.config.devices.automation.automations"
- ),
- "type",
- this.hass.localize(
- `ui.panel.config.devices.type.${
- device.entry_type || "device"
- }`
- )
- )}
-
- `}
-
- `
- : ""
- }
- ${
- isComponentLoaded(this.hass, "scene") && entities.length
- ? html`
-
-
- ${this._related?.scene?.length
- ? html`
-
- ${this._related.scene.map((scene) => {
- const entityState = this.hass.states[scene];
- return entityState
- ? html`
-
- `
- : "";
- })}
-
- `
- : html`
-
- ${this.hass.localize(
- "ui.panel.config.devices.add_prompt",
- "name",
- this.hass.localize(
- "ui.panel.config.devices.scene.scenes"
- ),
- "type",
- this.hass.localize(
- `ui.panel.config.devices.type.${
- device.entry_type || "device"
- }`
- )
- )}
-
- `}
-
- `
- : ""
- }
- ${
- isComponentLoaded(this.hass, "script")
- ? html`
-
-
- ${this._related?.script?.length
- ? html`
-
- `
- : html`
-
- ${this.hass.localize(
- "ui.panel.config.devices.add_prompt",
- "name",
- this.hass.localize(
- "ui.panel.config.devices.script.scripts"
- ),
- "type",
- this.hass.localize(
- `ui.panel.config.devices.type.${
- device.entry_type || "device"
- }`
- )
- )}
-
- `}
-
- `
- : ""
- }
+ ${!this.narrow ? [automationCard, sceneCard, scriptCard] : ""}
${["control", "sensor", "config", "diagnostic"].map((category) =>
@@ -798,6 +791,7 @@ export class HaConfigDevicePage extends LitElement {
)}
+ ${this.narrow ? [automationCard, sceneCard, scriptCard] : ""}
${
isComponentLoaded(this.hass, "logbook")
? html`