diff --git a/src/panels/config/integrations/ha-config-entry-device-row.ts b/src/panels/config/integrations/ha-config-entry-device-row.ts index d122f3c67b..9bf576fb33 100644 --- a/src/panels/config/integrations/ha-config-entry-device-row.ts +++ b/src/panels/config/integrations/ha-config-entry-device-row.ts @@ -1,7 +1,9 @@ import { mdiCogOutline, mdiDelete, + mdiDevices, mdiDotsVertical, + mdiPencil, mdiStopCircleOutline, } from "@mdi/js"; import { css, html, LitElement, nothing } from "lit"; @@ -24,6 +26,7 @@ import { } from "../../lovelace/custom-card-helpers"; import { showDeviceRegistryDetailDialog } from "../devices/device-registry-detail/show-dialog-device-registry-detail"; import "./ha-config-sub-entry-row"; +import { stopPropagation } from "../../../common/dom/stop_propagation"; @customElement("ha-config-entry-device-row") class HaConfigEntryDeviceRow extends LitElement { @@ -49,34 +52,46 @@ class HaConfigEntryDeviceRow extends LitElement { area ? area.name : undefined, ].filter(Boolean); - return html` -
${computeDeviceNameDisplay(device, this.hass)}
+ return html` + +
${computeDeviceNameDisplay(device, this.hass)} ${supportingText.join(" • ")} ${supportingText.length && entities.length ? " • " : nothing} ${ entities.length - ? html`${this.hass.localize( + ? this.narrow + ? this.hass.localize( "ui.panel.config.integrations.config_entry.entities", { count: entities.length } - )}` + ) + : html`${this.hass.localize( + "ui.panel.config.integrations.config_entry.entities", + { count: entities.length } + )}` : nothing } - - + ${ + !this.narrow + ? html` + ` + : nothing + } -
+
${ !this.narrow ? html` - + this.entities?.filter((entity) => entity.device_id === this.device.id); - private _handleConfigureDevice() { + private _handleConfigureDevice(ev: MouseEvent) { + ev.stopPropagation(); // Prevent triggering the click handler on the list item showDeviceRegistryDetailDialog(this, { device: this.device, updateEntry: async (updates) => { @@ -204,6 +220,9 @@ class HaConfigEntryDeviceRow extends LitElement { ha-md-list-item { --md-list-item-leading-space: 56px; } + :host([narrow]) ha-md-list-item { + --md-list-item-leading-space: 16px; + } .vertical-divider { height: 100%; width: 1px;