Skip to content

Commit

Permalink
Use platform icon color in entity configuration (#198)
Browse files Browse the repository at this point in the history
  • Loading branch information
farmio authored Jan 22, 2025
1 parent fa8d50f commit a8cd8b1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/components/knx-configure-entity.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import type { TemplateResult } from "lit";
import { css, html, LitElement, nothing } from "lit";
import { customElement, property } from "lit/decorators";
import { styleMap } from "lit/directives/style-map";

import "@ha/components/ha-card";
import "@ha/components/ha-control-select";
Expand Down Expand Up @@ -50,7 +51,13 @@ export class KNXConfigureEntity extends LitElement {
const errors = extractValidationErrors(this.validationErrors, "data"); // "data" is root key in our python schema
return html`
<div class="header">
<h1><ha-svg-icon .path=${this.platform.iconPath}></ha-svg-icon>${this.platform.name}</h1>
<h1>
<ha-svg-icon
.path=${this.platform.iconPath}
style=${styleMap({ "background-color": this.platform.color })}
></ha-svg-icon>
${this.platform.name}
</h1>
<p>${this.platform.description}</p>
</div>
<slot name="knx-validation-error"></slot>
Expand Down

0 comments on commit a8cd8b1

Please sign in to comment.