mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-27 11:16:35 +00:00
Fix describing device conditions in trace viewer (#24645)
This commit is contained in:
parent
d4717f1293
commit
05aa55bfb9
@ -1,4 +1,5 @@
|
|||||||
import { dump } from "js-yaml";
|
import { dump } from "js-yaml";
|
||||||
|
import { consume } from "@lit-labs/context";
|
||||||
import type { CSSResultGroup, TemplateResult } from "lit";
|
import type { CSSResultGroup, TemplateResult } from "lit";
|
||||||
import { css, html, LitElement, nothing } from "lit";
|
import { css, html, LitElement, nothing } from "lit";
|
||||||
import { customElement, property, state } from "lit/decorators";
|
import { customElement, property, state } from "lit/decorators";
|
||||||
@ -19,6 +20,8 @@ import { traceTabStyles } from "./trace-tab-styles";
|
|||||||
import type { HomeAssistant } from "../../types";
|
import type { HomeAssistant } from "../../types";
|
||||||
import type { NodeInfo } from "./hat-script-graph";
|
import type { NodeInfo } from "./hat-script-graph";
|
||||||
import { describeCondition } from "../../data/automation_i18n";
|
import { describeCondition } from "../../data/automation_i18n";
|
||||||
|
import type { EntityRegistryEntry } from "../../data/entity_registry";
|
||||||
|
import { fullEntitiesContext } from "../../data/context";
|
||||||
|
|
||||||
const TRACE_PATH_TABS = [
|
const TRACE_PATH_TABS = [
|
||||||
"step_config",
|
"step_config",
|
||||||
@ -45,6 +48,10 @@ export class HaTracePathDetails extends LitElement {
|
|||||||
|
|
||||||
@state() private _view: (typeof TRACE_PATH_TABS)[number] = "step_config";
|
@state() private _view: (typeof TRACE_PATH_TABS)[number] = "step_config";
|
||||||
|
|
||||||
|
@state()
|
||||||
|
@consume({ context: fullEntitiesContext, subscribe: true })
|
||||||
|
_entityReg!: EntityRegistryEntry[];
|
||||||
|
|
||||||
protected render(): TemplateResult {
|
protected render(): TemplateResult {
|
||||||
return html`
|
return html`
|
||||||
<div class="padded-box trace-info">
|
<div class="padded-box trace-info">
|
||||||
@ -166,7 +173,7 @@ export class HaTracePathDetails extends LitElement {
|
|||||||
? html`[${describeCondition(
|
? html`[${describeCondition(
|
||||||
currentDetail,
|
currentDetail,
|
||||||
this.hass,
|
this.hass,
|
||||||
currentDetail.alias
|
this._entityReg
|
||||||
)}]<br />`
|
)}]<br />`
|
||||||
: nothing}
|
: nothing}
|
||||||
${this.hass!.localize(
|
${this.hass!.localize(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user