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,10 +69,16 @@ class HaCallServiceButton extends EventsMixin(PolymerElement) {
|
|||||||
el.$.progress.actionSuccess();
|
el.$.progress.actionSuccess();
|
||||||
eventData.success = true;
|
eventData.success = true;
|
||||||
},
|
},
|
||||||
function () {
|
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;
|
el.progress = false;
|
||||||
el.$.progress.actionError();
|
|
||||||
eventData.success = false;
|
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
.then(function () {
|
.then(function () {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user