From 30af576ff5c4230c722ce9a497243560c499ebf6 Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Wed, 31 May 2023 14:04:45 +0200 Subject: [PATCH] Remove unused old code (#16691) --- .../integrations/ha-integration-card.ts | 78 ++++++------------- 1 file changed, 23 insertions(+), 55 deletions(-) diff --git a/src/panels/config/integrations/ha-integration-card.ts b/src/panels/config/integrations/ha-integration-card.ts index 1567b44cb2..5b83d20dbf 100644 --- a/src/panels/config/integrations/ha-integration-card.ts +++ b/src/panels/config/integrations/ha-integration-card.ts @@ -2,17 +2,9 @@ import "@lrnwebcomponents/simple-tooltip/simple-tooltip"; import "@material/mwc-button"; import "@material/mwc-list"; import { mdiApplication, mdiCog, mdiDevices, mdiShape } from "@mdi/js"; -import { - css, - CSSResultGroup, - html, - LitElement, - nothing, - TemplateResult, -} from "lit"; +import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit"; import { customElement, property } from "lit/decorators"; import { classMap } from "lit/directives/class-map"; -import { ifDefined } from "lit/directives/if-defined"; import memoizeOne from "memoize-one"; import "../../../components/ha-card"; import "../../../components/ha-icon-button"; @@ -105,64 +97,40 @@ export class HaIntegrationCard extends LitElement {
${devices.length > 0 ? html` 1 - ? `/config/devices/dashboard?historyBack=1&domain=${this.domain}` - : undefined - )} + href=${devices.length === 1 + ? `/config/devices/device/${devices[0].id}` + : `/config/devices/dashboard?historyBack=1&domain=${this.domain}`} > - + - ${devices.length === 0 - ? "No devices" - : this.hass.localize( - `ui.panel.config.integrations.config_entry.${ - services ? "services" : "devices" - }`, - "count", - devices.length - )} - ${devices.length === 0 - ? nothing - : html``} + ${this.hass.localize( + `ui.panel.config.integrations.config_entry.${ + services ? "services" : "devices" + }`, + "count", + devices.length + )} + ` : ""} ${entities.length > 0 ? html` - + - ${entities.length === 0 - ? "No entities" - : this.hass.localize( - `ui.panel.config.integrations.config_entry.entities`, - "count", - entities.length - )} - ${entities.length === 0 - ? nothing - : html``} - ` + ${this.hass.localize( + `ui.panel.config.integrations.config_entry.entities`, + "count", + entities.length + )} + + + ` : ""}
`;