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