mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-29 04:06:35 +00:00
Sort listening entity and domain in template dev tools (#6953)
This commit is contained in:
parent
c979cfb912
commit
266f2e763d
@ -14,8 +14,8 @@ import { debounce } from "../../../common/util/debounce";
|
|||||||
import "../../../components/ha-circular-progress";
|
import "../../../components/ha-circular-progress";
|
||||||
import "../../../components/ha-code-editor";
|
import "../../../components/ha-code-editor";
|
||||||
import {
|
import {
|
||||||
subscribeRenderTemplate,
|
|
||||||
RenderTemplateResult,
|
RenderTemplateResult,
|
||||||
|
subscribeRenderTemplate,
|
||||||
} from "../../../data/ws-templates";
|
} from "../../../data/ws-templates";
|
||||||
import { haStyle } from "../../../resources/styles";
|
import { haStyle } from "../../../resources/styles";
|
||||||
import { HomeAssistant } from "../../../types";
|
import { HomeAssistant } from "../../../types";
|
||||||
@ -151,41 +151,49 @@ class HaPanelDevTemplate extends LitElement {
|
|||||||
? ""
|
? ""
|
||||||
: this._templateResult.listeners.all
|
: this._templateResult.listeners.all
|
||||||
? html`
|
? html`
|
||||||
<span class="all_listeners">
|
<h3 class="all_listeners">
|
||||||
${this.hass.localize(
|
${this.hass.localize(
|
||||||
"ui.panel.developer-tools.tabs.templates.all_listeners"
|
"ui.panel.developer-tools.tabs.templates.all_listeners"
|
||||||
)}
|
)}
|
||||||
</span>
|
</h3>
|
||||||
`
|
`
|
||||||
: this._templateResult.listeners.domains.length ||
|
: this._templateResult.listeners.domains.length ||
|
||||||
this._templateResult.listeners.entities.length
|
this._templateResult.listeners.entities.length
|
||||||
? html`
|
? html`
|
||||||
${this.hass.localize(
|
<h3>
|
||||||
"ui.panel.developer-tools.tabs.templates.listeners"
|
${this.hass.localize(
|
||||||
)}
|
"ui.panel.developer-tools.tabs.templates.listeners"
|
||||||
|
)}
|
||||||
|
</h3>
|
||||||
<ul>
|
<ul>
|
||||||
${this._templateResult.listeners.domains.map(
|
${this._templateResult.listeners.domains
|
||||||
(domain) =>
|
.sort()
|
||||||
html`
|
.map(
|
||||||
<li>
|
(domain) =>
|
||||||
${this.hass.localize(
|
html`
|
||||||
"ui.panel.developer-tools.tabs.templates.domain"
|
<li>
|
||||||
)}:
|
<b
|
||||||
${domain}
|
>${this.hass.localize(
|
||||||
</li>
|
"ui.panel.developer-tools.tabs.templates.domain"
|
||||||
`
|
)}</b
|
||||||
)}
|
>: ${domain}
|
||||||
${this._templateResult.listeners.entities.map(
|
</li>
|
||||||
(entity_id) =>
|
`
|
||||||
html`
|
)}
|
||||||
<li>
|
${this._templateResult.listeners.entities
|
||||||
${this.hass.localize(
|
.sort()
|
||||||
"ui.panel.developer-tools.tabs.templates.entity"
|
.map(
|
||||||
)}:
|
(entity_id) =>
|
||||||
${entity_id}
|
html`
|
||||||
</li>
|
<li>
|
||||||
`
|
<b
|
||||||
)}
|
>${this.hass.localize(
|
||||||
|
"ui.panel.developer-tools.tabs.templates.entity"
|
||||||
|
)}</b
|
||||||
|
>: ${entity_id}
|
||||||
|
</li>
|
||||||
|
`
|
||||||
|
)}
|
||||||
</ul>
|
</ul>
|
||||||
`
|
`
|
||||||
: html` <span class="all_listeners">
|
: html` <span class="all_listeners">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user