mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-21 08:16:36 +00:00
Fix theme on sensor card (#4724)
This commit is contained in:
parent
cbe4782d78
commit
ad676d7fd3
@ -285,7 +285,7 @@ class HuiSensorCard extends LitElement implements LovelaceCard {
|
|||||||
|
|
||||||
protected updated(changedProps: PropertyValues) {
|
protected updated(changedProps: PropertyValues) {
|
||||||
super.updated(changedProps);
|
super.updated(changedProps);
|
||||||
if (!this._config || this._config.graph !== "line" || !this.hass) {
|
if (!this._config || !this.hass) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -303,6 +303,7 @@ class HuiSensorCard extends LitElement implements LovelaceCard {
|
|||||||
applyThemesOnElement(this, this.hass.themes, this._config!.theme);
|
applyThemesOnElement(this, this.hass.themes, this._config!.theme);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this._config.graph === "line") {
|
||||||
const minute = 60000;
|
const minute = 60000;
|
||||||
if (changedProps.has("_config")) {
|
if (changedProps.has("_config")) {
|
||||||
this._getHistory();
|
this._getHistory();
|
||||||
@ -310,6 +311,7 @@ class HuiSensorCard extends LitElement implements LovelaceCard {
|
|||||||
this._getHistory();
|
this._getHistory();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private _handleClick(): void {
|
private _handleClick(): void {
|
||||||
fireEvent(this, "hass-more-info", { entityId: this._config!.entity });
|
fireEvent(this, "hass-more-info", { entityId: this._config!.entity });
|
||||||
|
Loading…
x
Reference in New Issue
Block a user