Fix theme on sensor card (#4724)
This commit is contained in:
@@ -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,11 +303,13 @@ class HuiSensorCard extends LitElement implements LovelaceCard {
|
|||||||
applyThemesOnElement(this, this.hass.themes, this._config!.theme);
|
applyThemesOnElement(this, this.hass.themes, this._config!.theme);
|
||||||
}
|
}
|
||||||
|
|
||||||
const minute = 60000;
|
if (this._config.graph === "line") {
|
||||||
if (changedProps.has("_config")) {
|
const minute = 60000;
|
||||||
this._getHistory();
|
if (changedProps.has("_config")) {
|
||||||
} else if (Date.now() - this._date!.getTime() >= minute) {
|
this._getHistory();
|
||||||
this._getHistory();
|
} else if (Date.now() - this._date!.getTime() >= minute) {
|
||||||
|
this._getHistory();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user