mirror of
https://github.com/home-assistant/frontend.git
synced 2025-08-02 14:07:55 +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 {
|
try {
|
||||||
this._yaml =
|
this._yaml =
|
||||||
value && !isEmpty(value)
|
value && !isEmpty(value)
|
||||||
? dump(value, { schema: this.yamlSchema })
|
? dump(value, { schema: this.yamlSchema, quotingType: '"' })
|
||||||
: "";
|
: "";
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
// eslint-disable-next-line no-console
|
// 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 { customElement, property, state } from "lit/decorators";
|
||||||
import { formatTime } from "../../../common/datetime/format_time";
|
import { formatTime } from "../../../common/datetime/format_time";
|
||||||
import "../../../components/ha-card";
|
import "../../../components/ha-card";
|
||||||
|
import "../../../components/ha-yaml-editor";
|
||||||
import "../../../components/ha-textfield";
|
import "../../../components/ha-textfield";
|
||||||
import { HomeAssistant } from "../../../types";
|
import { HomeAssistant } from "../../../types";
|
||||||
|
|
||||||
@ -74,7 +75,10 @@ class EventSubscribeCard extends LitElement {
|
|||||||
ev.id
|
ev.id
|
||||||
)}
|
)}
|
||||||
${formatTime(new Date(ev.event.time_fired), this.hass!.locale)}:
|
${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>
|
</div>
|
||||||
`
|
`
|
||||||
)}
|
)}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user