reset entity properties on 404 (#1591)

This commit is contained in:
John Arild Berentsen 2018-08-23 22:23:00 +02:00 committed by Paulus Schoutsen
parent 74185f0beb
commit 144f00e2cc

View File

@ -496,8 +496,16 @@ class HaConfigZwave extends LocalizeMixin(PolymerElement) {
const valueIndex = this.values.indexOf(valueData); const valueIndex = this.values.indexOf(valueData);
this.hass.callApi('GET', `config/zwave/device_config/${this.entities[selectedEntity].entity_id}`) this.hass.callApi('GET', `config/zwave/device_config/${this.entities[selectedEntity].entity_id}`)
.then((data) => { .then((data) => {
this.entityIgnored = data.ignored || false; this.setProperties({
this.entityPollingIntensity = this.values[valueIndex].value.poll_intensity; entityIgnored: data.ignored || false,
entityPollingIntensity: this.values[valueIndex].value.poll_intensity
});
})
.catch(() => {
this.setProperties({
entityIgnored: false,
entityPollingIntensity: this.values[valueIndex].value.poll_intensity
});
}); });
} }