diff --git a/src/panels/lovelace/cards/hui-media-control-card.ts b/src/panels/lovelace/cards/hui-media-control-card.ts
index f901767a9d..8442872892 100644
--- a/src/panels/lovelace/cards/hui-media-control-card.ts
+++ b/src/panels/lovelace/cards/hui-media-control-card.ts
@@ -332,7 +332,7 @@ export class HuiMediaControlCard extends LitElement implements LovelaceCard {
protected updated(changedProps: PropertyValues): void {
super.updated(changedProps);
- if (!this._config || !this.hass || !changedProps.has("hass")) {
+ if (!this._config || !this.hass || (!changedProps.has("_config") && !changedProps.has("hass"))) {
return;
}
diff --git a/src/panels/lovelace/cards/types.ts b/src/panels/lovelace/cards/types.ts
index 673f4959d4..bf0fcfbb10 100644
--- a/src/panels/lovelace/cards/types.ts
+++ b/src/panels/lovelace/cards/types.ts
@@ -37,6 +37,7 @@ export interface EmptyStateCardConfig extends LovelaceCardConfig {
export interface EntityCardConfig extends LovelaceCardConfig {
attribute?: string;
unit?: string;
+ theme?: string;
}
export interface EntitiesCardEntityConfig extends EntityConfig {
@@ -174,6 +175,7 @@ export interface LogbookCardConfig extends LovelaceCardConfig {
entities: string[];
title?: string;
hours_to_show?: number;
+ theme?: string;
}
export interface MapCardConfig extends LovelaceCardConfig {
@@ -198,6 +200,7 @@ export interface MarkdownCardConfig extends LovelaceCardConfig {
export interface MediaControlCardConfig extends LovelaceCardConfig {
entity: string;
+ theme?: string;
}
export interface HistoryGraphCardConfig extends LovelaceCardConfig {
@@ -311,4 +314,5 @@ export interface WeatherForecastCardConfig extends LovelaceCardConfig {
name?: string;
show_forecast?: boolean;
secondary_info_attribute?: string;
+ theme?: string;
}
diff --git a/src/panels/lovelace/editor/config-elements/hui-media-control-card-editor.ts b/src/panels/lovelace/editor/config-elements/hui-media-control-card-editor.ts
index 8a18b7060e..5d2b6f82fa 100644
--- a/src/panels/lovelace/editor/config-elements/hui-media-control-card-editor.ts
+++ b/src/panels/lovelace/editor/config-elements/hui-media-control-card-editor.ts
@@ -11,12 +11,14 @@ import { fireEvent } from "../../../../common/dom/fire_event";
import "../../../../components/entity/ha-entity-picker";
import { HomeAssistant } from "../../../../types";
import { MediaControlCardConfig } from "../../cards/types";
+import "../../components/hui-theme-select-editor";
import { LovelaceCardEditor } from "../../types";
import { EditorTarget, EntitiesEditorEvent } from "../types";
const cardConfigStruct = object({
type: string(),
entity: optional(string()),
+ theme: optional(string()),
});
const includeDomains = ["media_player"];
@@ -37,6 +39,10 @@ export class HuiMediaControlCardEditor extends LitElement
return this._config!.entity || "";
}
+ get _theme(): string {
+ return this._config!.theme || "";
+ }
+
protected render(): TemplateResult {
if (!this.hass || !this._config) {
return html``;
@@ -57,6 +63,12 @@ export class HuiMediaControlCardEditor extends LitElement
@change="${this._valueChanged}"
allow-custom-entity
>
+