Add top level logbook entries tab (#8776)

This commit is contained in:
Bram Kragten 2021-03-31 18:15:06 +02:00 committed by GitHub
parent d8153ac8fc
commit 9b947ef734
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -66,8 +66,11 @@ export class HaAutomationTrace extends LitElement {
@internalProperty() private _logbookEntries?: LogbookEntry[];
@internalProperty() private _view: "details" | "config" | "timeline" =
"details";
@internalProperty() private _view:
| "details"
| "config"
| "timeline"
| "logbook" = "details";
protected render(): TemplateResult {
const stateObj = this._entityId
@ -181,6 +184,7 @@ export class HaAutomationTrace extends LitElement {
${[
["details", "Step Details"],
["timeline", "Trace Timeline"],
["logbook", "Related logbook entries"],
["config", "Automation Config"],
].map(
([view, label]) => html`
@ -216,6 +220,13 @@ export class HaAutomationTrace extends LitElement {
.trace=${this._trace}
></ha-automation-trace-config>
`
: this._view === "logbook"
? html`
<ha-logbook
.hass=${this.hass}
.entries=${this._logbookEntries}
></ha-logbook>
`
: html`
<ha-automation-trace-timeline
.hass=${this.hass}