From 1f6f2c926017197fa69fad261936b5de728d8751 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Thu, 11 May 2017 21:17:21 -0700 Subject: [PATCH] Include response in api call response --- src/components/buttons/ha-call-api-button.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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); });