Include response in api call response

This commit is contained in:
Paulus Schoutsen 2017-05-11 21:17:21 -07:00
parent 95b2fa0ad3
commit 1f6f2c9260

View File

@ -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);
});