Skip to content

Commit

Permalink
Add themes to entities (#1909)
Browse files Browse the repository at this point in the history
  • Loading branch information
zsarnett authored and balloob committed Oct 29, 2018
1 parent 630214d commit 00935c8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions src/panels/lovelace/cards/hui-entities-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ import "../components/hui-entities-toggle.js";
import { fireEvent } from "../../../common/dom/fire_event.js";
import { DOMAINS_HIDE_MORE_INFO } from "../../../common/const.js";
import { hassLocalizeLitMixin } from "../../../mixins/lit-localize-mixin";
import { HomeAssistant } from "../../../types.js";
import { EntityConfig, EntityRow } from "../entity-rows/types.js";
import { LovelaceCard, LovelaceConfig } from "../types.js";
import processConfigEntities from "../common/process-config-entities";
import createRowElement from "../common/create-row-element.js";
import computeDomain from "../../../common/entity/compute_domain.js";
import processConfigEntities from "../common/process-config-entities";
import { HomeAssistant } from "../../../types.js";
import { EntityConfig, EntityRow } from "../entity-rows/types.js";
import applyThemesOnElement from "../../../common/dom/apply_themes_on_element.js";

interface ConfigEntity extends EntityConfig {
type?: string;
Expand All @@ -26,6 +27,7 @@ interface Config extends LovelaceConfig {
show_header_toggle?: boolean;
title?: string;
entities: ConfigEntity[];
theme?: string;
}

class HuiEntitiesCard extends hassLocalizeLitMixin(LitElement)
Expand Down Expand Up @@ -72,7 +74,7 @@ class HuiEntitiesCard extends hassLocalizeLitMixin(LitElement)
}
}

this._config = config;
this._config = { theme: "default", ...config };
this._configEntities = entities;
}

Expand All @@ -82,6 +84,8 @@ class HuiEntitiesCard extends hassLocalizeLitMixin(LitElement)
}
const { show_header_toggle, title } = this._config;

applyThemesOnElement(this, this._hass.themes, this._config.theme);

return html`
${this.renderStyle()}
<ha-card>
Expand Down

0 comments on commit 00935c8

Please sign in to comment.