Skip to content

Commit

Permalink
descriptions in blueprints also
Browse files Browse the repository at this point in the history
  • Loading branch information
karwosts committed May 11, 2024
1 parent 8d9d709 commit 5751489
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 6 deletions.
13 changes: 9 additions & 4 deletions src/panels/config/automation/blueprint-automation-editor.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import "@material/mwc-button/mwc-button";
import { HassEntity } from "home-assistant-js-websocket";
import { html } from "lit";
import { html, nothing } from "lit";
import { customElement, property } from "lit/decorators";
import "../../../components/ha-alert";
import { BlueprintAutomationConfig } from "../../../data/automation";
import { fetchBlueprints } from "../../../data/blueprint";
import { HaBlueprintGenericEditor } from "../blueprint/blueprint-generic-editor";
import "../../../components/ha-markdown";

@customElement("blueprint-automation-editor")
export class HaBlueprintAutomationEditor extends HaBlueprintGenericEditor {
Expand All @@ -26,7 +27,7 @@ export class HaBlueprintAutomationEditor extends HaBlueprintGenericEditor {
${this.hass.localize("ui.panel.config.automation.editor.migrate")}
</mwc-button>
</ha-alert>`
: ""}
: nothing}
${this.stateObj?.state === "off"
? html`
<ha-alert alert-type="info">
Expand All @@ -42,8 +43,12 @@ export class HaBlueprintAutomationEditor extends HaBlueprintGenericEditor {
`
: ""}
${this.config.description
? html`<p class="description">${this.config.description}</p>`
: ""}
? html`<ha-markdown
class="description"
breaks
.content=${this.config.description}
></ha-markdown>`
: nothing}
${this.renderCard()}
`;
}
Expand Down
13 changes: 11 additions & 2 deletions src/panels/config/script/blueprint-script-editor.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import { html } from "lit";
import "@material/mwc-button/mwc-button";
import { html, nothing } from "lit";
import { customElement, property } from "lit/decorators";
import "../../../components/ha-alert";
import { BlueprintScriptConfig } from "../../../data/script";
import { fetchBlueprints } from "../../../data/blueprint";
import { HaBlueprintGenericEditor } from "../blueprint/blueprint-generic-editor";
import "../../../components/ha-markdown";

@customElement("blueprint-script-editor")
export class HaBlueprintScriptEditor extends HaBlueprintGenericEditor {
Expand All @@ -22,7 +24,14 @@ export class HaBlueprintScriptEditor extends HaBlueprintGenericEditor {
${this.hass.localize("ui.panel.config.script.editor.migrate")}
</mwc-button>
</ha-alert>`
: ""}
: nothing}
${this.config.description
? html`<ha-markdown
class="description"
breaks
.content=${this.config.description}
></ha-markdown>`
: nothing}
${this.renderCard()}
`;
}
Expand Down

0 comments on commit 5751489

Please sign in to comment.