mirror of
https://github.com/home-assistant/frontend.git
synced 2025-08-01 13:37:47 +00:00
Use YAML in developer tools events (#13222)
This commit is contained in:
parent
9309a4c7bc
commit
6ac4560b36
@ -41,7 +41,7 @@ export class HaYamlEditor extends LitElement {
|
||||
try {
|
||||
this._yaml =
|
||||
value && !isEmpty(value)
|
||||
? dump(value, { schema: this.yamlSchema })
|
||||
? dump(value, { schema: this.yamlSchema, quotingType: '"' })
|
||||
: "";
|
||||
} catch (err: any) {
|
||||
// eslint-disable-next-line no-console
|
||||
|
@ -4,6 +4,7 @@ import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit";
|
||||
import { customElement, property, state } from "lit/decorators";
|
||||
import { formatTime } from "../../../common/datetime/format_time";
|
||||
import "../../../components/ha-card";
|
||||
import "../../../components/ha-yaml-editor";
|
||||
import "../../../components/ha-textfield";
|
||||
import { HomeAssistant } from "../../../types";
|
||||
|
||||
@ -74,7 +75,10 @@ class EventSubscribeCard extends LitElement {
|
||||
ev.id
|
||||
)}
|
||||
${formatTime(new Date(ev.event.time_fired), this.hass!.locale)}:
|
||||
<pre>${JSON.stringify(ev.event, null, 4)}</pre>
|
||||
<ha-yaml-editor
|
||||
.defaultValue=${ev.event}
|
||||
readOnly
|
||||
></ha-code-editor>
|
||||
</div>
|
||||
`
|
||||
)}
|
||||
|
Loading…
x
Reference in New Issue
Block a user