mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-31 21:17:47 +00:00
Expect the connection to be lost
This commit is contained in:
parent
344b11a204
commit
41934320c0
@ -69,11 +69,17 @@ class HaCallServiceButton extends EventsMixin(PolymerElement) {
|
||||
el.$.progress.actionSuccess();
|
||||
eventData.success = true;
|
||||
},
|
||||
function () {
|
||||
el.progress = false;
|
||||
function (err) {
|
||||
if (err?.error?.message && err.error.message === "Connection lost") {
|
||||
// We expect the service call to fail with 'Connection lost' when we restart or stop
|
||||
el.$.progress.actionSuccess();
|
||||
eventData.success = true;
|
||||
} else {
|
||||
el.$.progress.actionError();
|
||||
eventData.success = false;
|
||||
}
|
||||
el.progress = false;
|
||||
}
|
||||
)
|
||||
.then(function () {
|
||||
el.fire("hass-service-called", eventData);
|
||||
|
Loading…
x
Reference in New Issue
Block a user