mirror of
https://github.com/home-assistant/frontend.git
synced 2025-08-01 13:37:47 +00:00
Clean up theme settings (#5395)
This commit is contained in:
parent
dfe808cfb4
commit
d5ed1c4c41
@ -82,7 +82,6 @@ export class HuiButtonCard extends LitElement implements LovelaceCard {
|
||||
}
|
||||
|
||||
this._config = {
|
||||
theme: "default",
|
||||
hold_action: { action: "more-info" },
|
||||
double_tap_action: { action: "none" },
|
||||
show_icon: true,
|
||||
|
@ -93,7 +93,7 @@ class HuiEntitiesCard extends LitElement implements LovelaceCard {
|
||||
public setConfig(config: EntitiesCardConfig): void {
|
||||
const entities = processConfigEntities(config.entities);
|
||||
|
||||
this._config = { theme: "default", ...config };
|
||||
this._config = config;
|
||||
this._configEntities = entities;
|
||||
if (config.show_header_toggle === undefined) {
|
||||
// Default value is show toggle if we can at least toggle 2 entities.
|
||||
|
@ -82,7 +82,7 @@ class HuiGaugeCard extends LitElement implements LovelaceCard {
|
||||
if (!isValidEntityId(config.entity)) {
|
||||
throw new Error("Invalid Entity");
|
||||
}
|
||||
this._config = { min: 0, max: 100, theme: "default", ...config };
|
||||
this._config = { min: 0, max: 100, ...config };
|
||||
}
|
||||
|
||||
public connectedCallback(): void {
|
||||
|
@ -74,7 +74,7 @@ export class HuiGlanceCard extends LitElement implements LovelaceCard {
|
||||
}
|
||||
|
||||
public setConfig(config: GlanceCardConfig): void {
|
||||
this._config = { theme: "default", state_color: true, ...config };
|
||||
this._config = { state_color: true, ...config };
|
||||
const entities = processConfigEntities<GlanceConfigEntity>(config.entities);
|
||||
|
||||
for (const entity of entities) {
|
||||
|
@ -70,7 +70,7 @@ export class HuiHistoryGraphCard extends LitElement implements LovelaceCard {
|
||||
throw new Error("Entities need to be an array");
|
||||
}
|
||||
|
||||
this._config = { theme: "default", ...config };
|
||||
this._config = config;
|
||||
this._configEntities = config.entities
|
||||
? processConfigEntities(config.entities)
|
||||
: [];
|
||||
|
@ -78,7 +78,6 @@ export class HuiLightCard extends LitElement implements LovelaceCard {
|
||||
}
|
||||
|
||||
this._config = {
|
||||
theme: "default",
|
||||
...config,
|
||||
tap_action: { action: "toggle" },
|
||||
};
|
||||
|
@ -212,7 +212,7 @@ export class HuiMediaControlCard extends LitElement implements LovelaceCard {
|
||||
throw new Error("Specify an entity from within the media_player domain.");
|
||||
}
|
||||
|
||||
this._config = { theme: "default", ...config };
|
||||
this._config = config;
|
||||
}
|
||||
|
||||
public connectedCallback(): void {
|
||||
|
@ -217,7 +217,6 @@ class HuiSensorCard extends LitElement implements LovelaceCard {
|
||||
|
||||
const cardConfig = {
|
||||
detail: 1,
|
||||
theme: "default",
|
||||
hours_to_show: 24,
|
||||
...config,
|
||||
};
|
||||
|
@ -87,7 +87,7 @@ export class HuiThermostatCard extends LitElement implements LovelaceCard {
|
||||
throw new Error("Specify an entity from within the climate domain.");
|
||||
}
|
||||
|
||||
this._config = { theme: "default", ...config };
|
||||
this._config = config;
|
||||
}
|
||||
|
||||
public connectedCallback(): void {
|
||||
|
@ -56,7 +56,7 @@ export class HuiAlarmPanelCardEditor extends LitElement
|
||||
}
|
||||
|
||||
get _theme(): string {
|
||||
return this._config!.theme || "Backend-selected";
|
||||
return this._config!.theme || "";
|
||||
}
|
||||
|
||||
protected render(): TemplateResult {
|
||||
|
@ -84,7 +84,7 @@ export class HuiButtonCardEditor extends LitElement
|
||||
}
|
||||
|
||||
get _theme(): string {
|
||||
return this._config!.theme || "default";
|
||||
return this._config!.theme || "";
|
||||
}
|
||||
|
||||
protected render(): TemplateResult {
|
||||
|
@ -63,7 +63,7 @@ export class HuiEntitiesCardEditor extends LitElement
|
||||
}
|
||||
|
||||
get _theme(): string {
|
||||
return this._config!.theme || "Backend-selected";
|
||||
return this._config!.theme || "";
|
||||
}
|
||||
|
||||
protected render(): TemplateResult {
|
||||
|
@ -65,7 +65,7 @@ export class HuiEntityCardEditor extends LitElement
|
||||
}
|
||||
|
||||
get _theme(): string {
|
||||
return this._config!.theme || "default";
|
||||
return this._config!.theme || "";
|
||||
}
|
||||
|
||||
protected render(): TemplateResult {
|
||||
@ -136,7 +136,7 @@ export class HuiEntityCardEditor extends LitElement
|
||||
.hass=${this.hass}
|
||||
.value=${this._theme}
|
||||
.configValue=${"theme"}
|
||||
@theme-changed=${this._valueChanged}
|
||||
@value-changed=${this._valueChanged}
|
||||
></hui-theme-select-editor>
|
||||
</div>
|
||||
`;
|
||||
|
@ -57,7 +57,7 @@ export class HuiGaugeCardEditor extends LitElement
|
||||
}
|
||||
|
||||
get _theme(): string {
|
||||
return this._config!.theme || "default";
|
||||
return this._config!.theme || "";
|
||||
}
|
||||
|
||||
get _min(): number {
|
||||
|
@ -60,7 +60,7 @@ export class HuiGlanceCardEditor extends LitElement
|
||||
}
|
||||
|
||||
get _theme(): string {
|
||||
return this._config!.theme || "Backend-selected";
|
||||
return this._config!.theme || "";
|
||||
}
|
||||
|
||||
get _columns(): number {
|
||||
|
@ -52,7 +52,7 @@ export class HuiLightCardEditor extends LitElement
|
||||
}
|
||||
|
||||
get _theme(): string {
|
||||
return this._config!.theme || "default";
|
||||
return this._config!.theme || "";
|
||||
}
|
||||
|
||||
get _entity(): string {
|
||||
|
@ -46,7 +46,7 @@ export class HuiMarkdownCardEditor extends LitElement
|
||||
}
|
||||
|
||||
get _theme(): string {
|
||||
return this._config!.theme || "Backend-selected";
|
||||
return this._config!.theme || "";
|
||||
}
|
||||
|
||||
protected render(): TemplateResult {
|
||||
|
@ -56,7 +56,7 @@ export class HuiPictureCardEditor extends LitElement
|
||||
}
|
||||
|
||||
get _theme(): string {
|
||||
return this._config!.theme || "Backend-selected";
|
||||
return this._config!.theme || "";
|
||||
}
|
||||
|
||||
protected render(): TemplateResult {
|
||||
|
@ -96,7 +96,7 @@ export class HuiPictureEntityCardEditor extends LitElement
|
||||
}
|
||||
|
||||
get _theme(): string {
|
||||
return this._config!.theme || "Backend-selected";
|
||||
return this._config!.theme || "";
|
||||
}
|
||||
|
||||
protected render(): TemplateResult {
|
||||
|
@ -107,7 +107,7 @@ export class HuiPictureGlanceCardEditor extends LitElement
|
||||
}
|
||||
|
||||
get _theme(): string {
|
||||
return this._config!.theme || "Backend-selected";
|
||||
return this._config!.theme || "";
|
||||
}
|
||||
|
||||
protected render(): TemplateResult {
|
||||
|
@ -47,7 +47,7 @@ export class HuiPlantStatusCardEditor extends LitElement
|
||||
}
|
||||
|
||||
get _theme(): string {
|
||||
return this._config!.theme || "Backend-selected";
|
||||
return this._config!.theme || "";
|
||||
}
|
||||
|
||||
protected render(): TemplateResult {
|
||||
|
@ -70,7 +70,7 @@ export class HuiSensorCardEditor extends LitElement
|
||||
}
|
||||
|
||||
get _theme(): string {
|
||||
return this._config!.theme || "default";
|
||||
return this._config!.theme || "";
|
||||
}
|
||||
|
||||
get _hours_to_show(): number | string {
|
||||
|
@ -42,7 +42,7 @@ export class HuiShoppingListEditor extends LitElement
|
||||
}
|
||||
|
||||
get _theme(): string {
|
||||
return this._config!.theme || "Backend-selected";
|
||||
return this._config!.theme || "";
|
||||
}
|
||||
|
||||
protected render(): TemplateResult {
|
||||
|
@ -46,7 +46,7 @@ export class HuiThermostatCardEditor extends LitElement
|
||||
}
|
||||
|
||||
get _theme(): string {
|
||||
return this._config!.theme || "default";
|
||||
return this._config!.theme || "";
|
||||
}
|
||||
|
||||
protected render(): TemplateResult {
|
||||
|
@ -45,7 +45,7 @@ export class HuiWeatherForecastCardEditor extends LitElement
|
||||
}
|
||||
|
||||
get _theme(): string {
|
||||
return this._config!.theme || "Backend-selected";
|
||||
return this._config!.theme || "";
|
||||
}
|
||||
|
||||
protected render(): TemplateResult {
|
||||
|
@ -117,7 +117,11 @@ export class HUIView extends LitElement {
|
||||
padding: 4px 4px 0;
|
||||
transform: translateZ(0);
|
||||
position: relative;
|
||||
background: var(--lovelace-background);
|
||||
color: var(--primary-text-color);
|
||||
background: var(
|
||||
--lovelace-background,
|
||||
var(--primary-background-color)
|
||||
);
|
||||
}
|
||||
|
||||
#badges {
|
||||
|
Loading…
x
Reference in New Issue
Block a user