1
0
mirror of https://github.com/home-assistant/frontend.git synced 2025-12-20 10:48:44 +00:00

Separate action field YAML examples (#27218)

* Comma separate field examples if it is a list

* Remove prettier ignore and json.stringify all examples

* Use YAML format

---------

Co-authored-by: Petar Petrov <MindFreeze@users.noreply.github.com>
This commit is contained in:
Dave T
2025-12-02 13:34:25 +00:00
committed by GitHub
parent 87c0b1d887
commit 38a907e51e

View File

@@ -1,7 +1,7 @@
import { mdiHelpCircle } from "@mdi/js"; import { mdiHelpCircle } from "@mdi/js";
import type { HassService } from "home-assistant-js-websocket"; import type { HassService } from "home-assistant-js-websocket";
import { ERR_CONNECTION_LOST } from "home-assistant-js-websocket"; import { ERR_CONNECTION_LOST } from "home-assistant-js-websocket";
import { load } from "js-yaml"; import { dump, load } from "js-yaml";
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, query, state } from "lit/decorators"; import { customElement, property, query, state } from "lit/decorators";
@@ -320,7 +320,10 @@ class HaPanelDevAction extends LitElement {
${this.hass.localize( ${this.hass.localize(
`component.${domain}.services.${serviceName}.fields.${field.key}.example`, `component.${domain}.services.${serviceName}.fields.${field.key}.example`,
descriptionPlaceholders descriptionPlaceholders
) || field.example} ) ||
(typeof field.example === "object"
? html`<pre>${dump(field.example)}</pre>`
: field.example)}
</td> </td>
</tr>` </tr>`
)} )}