mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Remove unused old code (#16691)
This commit is contained in:
parent
585db6ab3f
commit
30af576ff5
@ -2,17 +2,9 @@ import "@lrnwebcomponents/simple-tooltip/simple-tooltip";
|
|||||||
import "@material/mwc-button";
|
import "@material/mwc-button";
|
||||||
import "@material/mwc-list";
|
import "@material/mwc-list";
|
||||||
import { mdiApplication, mdiCog, mdiDevices, mdiShape } from "@mdi/js";
|
import { mdiApplication, mdiCog, mdiDevices, mdiShape } from "@mdi/js";
|
||||||
import {
|
import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit";
|
||||||
css,
|
|
||||||
CSSResultGroup,
|
|
||||||
html,
|
|
||||||
LitElement,
|
|
||||||
nothing,
|
|
||||||
TemplateResult,
|
|
||||||
} from "lit";
|
|
||||||
import { customElement, property } from "lit/decorators";
|
import { customElement, property } from "lit/decorators";
|
||||||
import { classMap } from "lit/directives/class-map";
|
import { classMap } from "lit/directives/class-map";
|
||||||
import { ifDefined } from "lit/directives/if-defined";
|
|
||||||
import memoizeOne from "memoize-one";
|
import memoizeOne from "memoize-one";
|
||||||
import "../../../components/ha-card";
|
import "../../../components/ha-card";
|
||||||
import "../../../components/ha-icon-button";
|
import "../../../components/ha-icon-button";
|
||||||
@ -105,64 +97,40 @@ export class HaIntegrationCard extends LitElement {
|
|||||||
<div class="content">
|
<div class="content">
|
||||||
${devices.length > 0
|
${devices.length > 0
|
||||||
? html`<a
|
? html`<a
|
||||||
href=${ifDefined(
|
href=${devices.length === 1
|
||||||
devices.length === 1
|
? `/config/devices/device/${devices[0].id}`
|
||||||
? `/config/devices/device/${devices[0].id}`
|
: `/config/devices/dashboard?historyBack=1&domain=${this.domain}`}
|
||||||
: devices.length > 1
|
|
||||||
? `/config/devices/dashboard?historyBack=1&domain=${this.domain}`
|
|
||||||
: undefined
|
|
||||||
)}
|
|
||||||
>
|
>
|
||||||
<ha-list-item
|
<ha-list-item hasMeta graphic="icon">
|
||||||
hasMeta
|
|
||||||
graphic="icon"
|
|
||||||
.noninteractive=${devices.length === 0}
|
|
||||||
>
|
|
||||||
<ha-svg-icon
|
<ha-svg-icon
|
||||||
.path=${services ? mdiApplication : mdiDevices}
|
.path=${services ? mdiApplication : mdiDevices}
|
||||||
slot="graphic"
|
slot="graphic"
|
||||||
></ha-svg-icon>
|
></ha-svg-icon>
|
||||||
${devices.length === 0
|
${this.hass.localize(
|
||||||
? "No devices"
|
`ui.panel.config.integrations.config_entry.${
|
||||||
: this.hass.localize(
|
services ? "services" : "devices"
|
||||||
`ui.panel.config.integrations.config_entry.${
|
}`,
|
||||||
services ? "services" : "devices"
|
"count",
|
||||||
}`,
|
devices.length
|
||||||
"count",
|
)}
|
||||||
devices.length
|
<ha-icon-next slot="meta"></ha-icon-next>
|
||||||
)}
|
|
||||||
${devices.length === 0
|
|
||||||
? nothing
|
|
||||||
: html`<ha-icon-next slot="meta"></ha-icon-next>`}
|
|
||||||
</ha-list-item>
|
</ha-list-item>
|
||||||
</a>`
|
</a>`
|
||||||
: ""}
|
: ""}
|
||||||
${entities.length > 0
|
${entities.length > 0
|
||||||
? html`<a
|
? html`<a
|
||||||
href=${ifDefined(
|
href=${`/config/entities?historyBack=1&domain=${this.domain}`}
|
||||||
entities.length
|
|
||||||
? `/config/entities?historyBack=1&domain=${this.domain}`
|
|
||||||
: undefined
|
|
||||||
)}
|
|
||||||
>
|
>
|
||||||
<ha-list-item
|
<ha-list-item hasMeta graphic="icon">
|
||||||
hasMeta
|
|
||||||
graphic="icon"
|
|
||||||
.noninteractive=${entities.length === 0}
|
|
||||||
>
|
|
||||||
<ha-svg-icon .path=${mdiShape} slot="graphic"></ha-svg-icon>
|
<ha-svg-icon .path=${mdiShape} slot="graphic"></ha-svg-icon>
|
||||||
${entities.length === 0
|
${this.hass.localize(
|
||||||
? "No entities"
|
`ui.panel.config.integrations.config_entry.entities`,
|
||||||
: this.hass.localize(
|
"count",
|
||||||
`ui.panel.config.integrations.config_entry.entities`,
|
entities.length
|
||||||
"count",
|
)}
|
||||||
entities.length
|
<ha-icon-next slot="meta"></ha-icon-next>
|
||||||
)}
|
</ha-list-item>
|
||||||
${entities.length === 0
|
</a>`
|
||||||
? nothing
|
|
||||||
: html`<ha-icon-next slot="meta"></ha-icon-next>`}
|
|
||||||
</ha-list-item></a
|
|
||||||
>`
|
|
||||||
: ""}
|
: ""}
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user