diff --git a/src/components/buttons/ha-call-api-button.html b/src/components/buttons/ha-call-api-button.html index 0fc31c07b8..1db75f824e 100644 --- a/src/components/buttons/ha-call-api-button.html +++ b/src/components/buttons/ha-call-api-button.html @@ -56,14 +56,16 @@ Polymer({ }; this.hass.callApi(this.method, this.path, this.data) - .then(function () { + .then(function (resp) { el.progress = false; el.$.progress.actionSuccess(); eventData.success = true; - }, function () { + eventData.response = resp; + }, function (resp) { el.progress = false; el.$.progress.actionError(); eventData.success = false; + eventData.response = resp; }).then(function () { el.fire('hass-api-called', eventData); });