Call super updated (#2293)

This commit is contained in:
Paulus Schoutsen 2018-12-13 15:26:23 +01:00 committed by Paulus Schoutsen
parent f683337cbe
commit d267196bff
11 changed files with 13 additions and 6 deletions

View File

@ -70,6 +70,7 @@ export class CloudExposedEntities extends LitElement {
} }
protected updated(changedProperties: PropertyValues) { protected updated(changedProperties: PropertyValues) {
super.updated(changedProperties);
if ( if (
changedProperties.has("filter") && changedProperties.has("filter") &&
changedProperties.get("filter") !== this.filter changedProperties.get("filter") !== this.filter

View File

@ -79,6 +79,7 @@ export class CloudWebhooks extends LitElement {
} }
protected updated(changedProps: PropertyValues) { protected updated(changedProps: PropertyValues) {
super.updated(changedProps);
if (changedProps.has("cloudStatus") && this.cloudStatus) { if (changedProps.has("cloudStatus") && this.cloudStatus) {
this._cloudHooks = this.cloudStatus.prefs.cloudhooks || {}; this._cloudHooks = this.cloudStatus.prefs.cloudhooks || {};
} }

View File

@ -88,7 +88,8 @@ class HuiEntitiesCard extends hassLocalizeLitMixin(LitElement)
this._configEntities = entities; this._configEntities = entities;
} }
protected updated(_changedProperties: PropertyValues): void { protected updated(changedProperties: PropertyValues): void {
super.updated(changedProperties);
if (this._hass && this._config) { if (this._hass && this._config) {
applyThemesOnElement(this, this._hass.themes, this._config.theme); applyThemesOnElement(this, this._hass.themes, this._config.theme);
} }

View File

@ -116,6 +116,7 @@ class HuiEntityButtonCard extends hassLocalizeLitMixin(LitElement)
} }
protected updated(changedProps: PropertyValues): void { protected updated(changedProps: PropertyValues): void {
super.updated(changedProps);
if (!this._config || !this.hass) { if (!this._config || !this.hass) {
return; return;
} }

View File

@ -110,11 +110,8 @@ class HuiGaugeCard extends LitElement implements LovelaceCard {
} }
protected updated(changedProps: PropertyValues): void { protected updated(changedProps: PropertyValues): void {
if ( super.updated(changedProps);
!this._config || if (!this._config || !this.hass) {
!this.hass ||
!this.shadowRoot!.getElementById("gauge")
) {
return; return;
} }
const stateObj = this.hass.states[this._config.entity]; const stateObj = this.hass.states[this._config.entity];

View File

@ -135,6 +135,7 @@ export class HuiGlanceCard extends hassLocalizeLitMixin(LitElement)
} }
protected updated(changedProperties: PropertyValues): void { protected updated(changedProperties: PropertyValues): void {
super.updated(changedProperties);
if (!this._config || !this.hass) { if (!this._config || !this.hass) {
return; return;
} }

View File

@ -154,6 +154,7 @@ export class HuiLightCard extends hassLocalizeLitMixin(LitElement)
} }
protected updated(changedProps: PropertyValues): void { protected updated(changedProps: PropertyValues): void {
super.updated(changedProps);
if (!this._config || !this.hass || !this._jQuery) { if (!this._config || !this.hass || !this._jQuery) {
return; return;
} }

View File

@ -265,6 +265,7 @@ class HuiSensorCard extends LitElement implements LovelaceCard {
} }
protected updated(changedProps: PropertyValues) { protected updated(changedProps: PropertyValues) {
super.updated(changedProps);
if (!this._config || this._config.graph !== "line" || !this.hass) { if (!this._config || this._config.graph !== "line" || !this.hass) {
return; return;
} }

View File

@ -25,6 +25,7 @@ class HuiEntitiesToggle extends LitElement {
} }
public updated(changedProperties: PropertyValues) { public updated(changedProperties: PropertyValues) {
super.updated(changedProperties);
if (changedProperties.has("entities")) { if (changedProperties.has("entities")) {
this._toggleEntities = this.entities!.filter( this._toggleEntities = this.entities!.filter(
(entityId) => (entityId) =>

View File

@ -78,6 +78,7 @@ class HuiTimestampDisplay extends hassLocalizeLitMixin(LitElement) {
} }
protected updated(changedProperties: PropertyValues) { protected updated(changedProperties: PropertyValues) {
super.updated(changedProperties);
if (!changedProperties.has("format") || !this._connected) { if (!changedProperties.has("format") || !this._connected) {
return; return;
} }

View File

@ -105,6 +105,7 @@ class LovelacePanel extends hassLocalizeLitMixin(LitElement) {
} }
public updated(changedProps: PropertyValues): void { public updated(changedProps: PropertyValues): void {
super.updated(changedProps);
if (changedProps.has("narrow") || changedProps.has("showMenu")) { if (changedProps.has("narrow") || changedProps.has("showMenu")) {
this._updateColumns(); this._updateColumns();
} }