diff --git a/src/dialogs/restart/dialog-restart.ts b/src/dialogs/restart/dialog-restart.ts index 880c909619..9b8491e68f 100644 --- a/src/dialogs/restart/dialog-restart.ts +++ b/src/dialogs/restart/dialog-restart.ts @@ -108,7 +108,6 @@ class DialogRestart extends LitElement { graphic="avatar" twoline multiline-secondary - hasMeta @request-selected=${this._reload} >
@@ -131,7 +130,6 @@ class DialogRestart extends LitElement { graphic="avatar" twoline multiline-secondary - hasMeta @request-selected=${this._restart} >
diff --git a/src/panels/config/integrations/ha-config-integrations.ts b/src/panels/config/integrations/ha-config-integrations.ts index 1243a04f57..d02d4b0b83 100644 --- a/src/panels/config/integrations/ha-config-integrations.ts +++ b/src/panels/config/integrations/ha-config-integrations.ts @@ -40,10 +40,6 @@ import { subscribeConfigFlowInProgress, } from "../../../data/config_flow"; import type { DataEntryFlowProgress } from "../../../data/data_entry_flow"; -import { - DeviceRegistryEntry, - subscribeDeviceRegistry, -} from "../../../data/device_registry"; import { fetchDiagnosticHandlers } from "../../../data/diagnostics"; import { EntityRegistryEntry, @@ -53,13 +49,13 @@ import { domainToName, fetchIntegrationManifest, fetchIntegrationManifests, - IntegrationManifest, IntegrationLogInfo, + IntegrationManifest, subscribeLogInfo, } from "../../../data/integration"; import { - getIntegrationDescriptions, findIntegration, + getIntegrationDescriptions, } from "../../../data/integrations"; import { scanUSBDevices } from "../../../data/usb"; import { showConfigFlowDialog } from "../../../dialogs/config-flow/show-dialog-config-flow"; @@ -139,9 +135,6 @@ class HaConfigIntegrations extends SubscribeMixin(LitElement) { @state() private _entityRegistryEntries: EntityRegistryEntry[] = []; - @state() - private _deviceRegistryEntries: DeviceRegistryEntry[] = []; - @state() private _manifests: Record = {}; @@ -168,9 +161,6 @@ class HaConfigIntegrations extends SubscribeMixin(LitElement) { subscribeEntityRegistry(this.hass.connection, (entries) => { this._entityRegistryEntries = entries; }), - subscribeDeviceRegistry(this.hass.connection, (entries) => { - this._deviceRegistryEntries = entries; - }), subscribeConfigFlowInProgress(this.hass, async (flowsInProgress) => { const integrations: Set = new Set(); const manifests: Set = new Set(); @@ -513,7 +503,6 @@ class HaConfigIntegrations extends SubscribeMixin(LitElement) { .items=${items} .manifest=${this._manifests[domain]} .entityRegistryEntries=${this._entityRegistryEntries} - .deviceRegistryEntries=${this._deviceRegistryEntries} > ` ) : ""} @@ -527,7 +516,6 @@ class HaConfigIntegrations extends SubscribeMixin(LitElement) { .items=${items} .manifest=${this._manifests[domain]} .entityRegistryEntries=${this._entityRegistryEntries} - .deviceRegistryEntries=${this._deviceRegistryEntries} .supportsDiagnostics=${this._diagnosticHandlers ? this._diagnosticHandlers[domain] : false} diff --git a/src/panels/config/integrations/ha-integration-card.ts b/src/panels/config/integrations/ha-integration-card.ts index 01007b14c2..f9c56194a1 100644 --- a/src/panels/config/integrations/ha-integration-card.ts +++ b/src/panels/config/integrations/ha-integration-card.ts @@ -1,5 +1,5 @@ import "@material/mwc-button"; -import "@material/mwc-list/mwc-list-item"; +import "@material/mwc-list"; import type { RequestSelectedDetail } from "@material/mwc-list/mwc-list-item"; import { mdiAlertCircle, @@ -20,8 +20,6 @@ import { mdiRenameBox, mdiStopCircleOutline, } from "@mdi/js"; -import "@polymer/paper-item/paper-item"; -import "@polymer/paper-listbox"; import "@lrnwebcomponents/simple-tooltip/simple-tooltip"; import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; import { customElement, property } from "lit/decorators"; @@ -30,6 +28,7 @@ import memoizeOne from "memoize-one"; import { shouldHandleRequestSelectedEvent } from "../../../common/mwc/handle-request-selected-event"; import "../../../components/ha-button-menu"; import "../../../components/ha-card"; +import "../../../components/ha-list-item"; import "../../../components/ha-icon-button"; import "../../../components/ha-icon-next"; import "../../../components/ha-svg-icon"; @@ -96,9 +95,6 @@ export class HaIntegrationCard extends LitElement { @property({ attribute: false }) public entityRegistryEntries!: EntityRegistryEntry[]; - @property({ attribute: false }) - public deviceRegistryEntries!: DeviceRegistryEntry[]; - @property() public selectedConfigEntryId?: string; @property({ type: Boolean }) public entryDisabled = false; @@ -174,20 +170,19 @@ export class HaIntegrationCard extends LitElement { private _renderGroupedIntegration(): TemplateResult { return html` - + ${this.items.map( (item) => - html`${item.title || - this.hass.localize( - "ui.panel.config.integrations.config_entry.unnamed_entry" - )} + >${item.title || + this.hass.localize( + "ui.panel.config.integrations.config_entry.unnamed_entry" + )} ${item.state === "setup_in_progress" - ? html` + ? html` ` - : ""} - ${ERROR_STATES.includes(item.state) - ? html` + : ERROR_STATES.includes(item.state) + ? html` ` - : ""} - - ` + : html``} + ` )} - + `; } private _renderSingleEntry(item: ConfigEntryExtended): TemplateResult { - const devices = this._getDevices(item, this.deviceRegistryEntries); - const services = this._getServices(item, this.deviceRegistryEntries); + const devices = this._getDevices(item, this.hass.devices); + const services = this._getServices(item, this.hass.devices); const entities = this._getEntities(item, this.entityRegistryEntries); let stateText: Parameters | undefined; @@ -380,7 +373,7 @@ export class HaIntegrationCard extends LitElement { RECOVERABLE_STATES.includes(item.state) && item.supports_unload && item.source !== "system" - ? html` @@ -388,22 +381,22 @@ export class HaIntegrationCard extends LitElement { "ui.panel.config.integrations.config_entry.reload" )} - ` + ` : ""} - + ${this.hass.localize( "ui.panel.config.integrations.config_entry.rename" )} - + ${this.supportsDiagnostics && item.state === "loaded" ? html` - + ${this.hass.localize( "ui.panel.config.integrations.config_entry.download_diagnostics" )} @@ -411,11 +404,11 @@ export class HaIntegrationCard extends LitElement { slot="graphic" .path=${mdiDownload} > - + ` : ""} ${this.logInfo - ? html` - ` + ` : ""} ${this.manifest && (this.manifest.is_built_in || @@ -453,7 +446,7 @@ export class HaIntegrationCard extends LitElement { rel="noreferrer" target="_blank" > - + ${this.hass.localize( "ui.panel.config.integrations.config_entry.documentation" )} @@ -462,7 +455,7 @@ export class HaIntegrationCard extends LitElement { .path=${mdiBookshelf} > - + ` : ""} ${this.manifest && @@ -472,19 +465,19 @@ export class HaIntegrationCard extends LitElement { rel="noreferrer" target="_blank" > - + ${this.hass.localize( "ui.panel.config.integrations.config_entry.known_issues" )} - + ` : ""}
  • - @@ -492,9 +485,9 @@ export class HaIntegrationCard extends LitElement { "ui.panel.config.integrations.config_entry.system_options" )} - + ${item.disabled_by === "user" - ? html` @@ -503,9 +496,9 @@ export class HaIntegrationCard extends LitElement { slot="graphic" .path=${mdiPlayCircleOutline} > - ` + ` : item.source !== "system" - ? html` - ` + ` : ""} ${item.source !== "system" - ? html` - ` + ` : ""}
    @@ -606,12 +599,12 @@ export class HaIntegrationCard extends LitElement { private _getDevices = memoizeOne( ( configEntry: ConfigEntry, - deviceRegistryEntries: DeviceRegistryEntry[] + deviceRegistryEntries: HomeAssistant["devices"] ): DeviceRegistryEntry[] => { if (!deviceRegistryEntries) { return []; } - return deviceRegistryEntries.filter( + return Object.values(deviceRegistryEntries).filter( (device) => device.config_entries.includes(configEntry.entry_id) && device.entry_type !== "service" @@ -622,12 +615,12 @@ export class HaIntegrationCard extends LitElement { private _getServices = memoizeOne( ( configEntry: ConfigEntry, - deviceRegistryEntries: DeviceRegistryEntry[] + deviceRegistryEntries: HomeAssistant["devices"] ): DeviceRegistryEntry[] => { if (!deviceRegistryEntries) { return []; } - return deviceRegistryEntries.filter( + return Object.values(deviceRegistryEntries).filter( (device) => device.config_entries.includes(configEntry.entry_id) && device.entry_type === "service" @@ -1001,16 +994,16 @@ export class HaIntegrationCard extends LitElement { color: var(--secondary-text-color); --mdc-menu-min-width: 200px; } - paper-listbox { + mwc-list { border-radius: 0 0 var(--ha-card-border-radius, 16px) var(--ha-card-border-radius, 16px); } @media (min-width: 563px) { ha-card.group { position: relative; - min-height: 164px; + min-height: 195px; } - paper-listbox { + mwc-list { position: absolute; top: 64px; left: 0; @@ -1018,25 +1011,24 @@ export class HaIntegrationCard extends LitElement { bottom: 0; overflow: auto; } - .disabled paper-listbox { + .disabled mwc-list { top: 88px; } } - paper-item { - cursor: pointer; - min-height: 35px; - } - paper-item-body { + ha-list-item { word-wrap: break-word; - display: -webkit-box; + display: -webkit-flex; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; text-overflow: ellipsis; } - mwc-list-item ha-svg-icon { + ha-list-item ha-svg-icon { color: var(--secondary-text-color); } + ha-icon-next { + width: 24px; + } ha-svg-icon[slot="meta"] { width: 18px; height: 18px;