diff --git a/src/dialogs/ha-more-info-dialog.js b/src/dialogs/ha-more-info-dialog.js index ec314e2a17..2d3ccbb2b5 100644 --- a/src/dialogs/ha-more-info-dialog.js +++ b/src/dialogs/ha-more-info-dialog.js @@ -141,11 +141,13 @@ class HaMoreInfoDialog extends DialogMixin(PolymerElement) { if (isComponentLoaded(this.hass, 'config.entity_registry') && (!oldVal || oldVal.entity_id !== newVal.entity_id)) { - this.hass.callApi('get', `config/entity_registry/${newVal.entity_id}`) - .then( - (info) => { this._registryInfo = info; }, - () => { this._registryInfo = false; } - ); + this.hass.connection.sendMessagePromise({ + type: 'config/entity_registry/get', + entity_id: newVal.entity_id, + }).then( + (msg) => { this._registryInfo = msg.result; }, + () => { this._registryInfo = false; } + ); } requestAnimationFrame(() => requestAnimationFrame(() => { diff --git a/src/dialogs/more-info/more-info-settings.js b/src/dialogs/more-info/more-info-settings.js index 673d6ef90e..99ab3795bd 100644 --- a/src/dialogs/more-info/more-info-settings.js +++ b/src/dialogs/more-info/more-info-settings.js @@ -93,15 +93,14 @@ class MoreInfoSettings extends EventsMixin(PolymerElement) { } _save() { - const data = { + this.hass.connection.sendMessagePromise({ + type: 'config/entity_registry/update', + entity_id: this.stateObj.entity_id, name: this._name, - }; - - this.hass.callApi('post', `config/entity_registry/${this.stateObj.entity_id}`, data) - .then( - (info) => { this.registryInfo = info; }, - () => { alert('save failed!'); } - ); + }).then( + (msg) => { this.registryInfo = msg.result; }, + () => { alert('save failed!'); } + ); } } customElements.define('more-info-settings', MoreInfoSettings);