mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-21 08:16:36 +00:00
Merge branch 'dev'
This commit is contained in:
commit
c60a235ad2
@ -64,7 +64,7 @@ gulp.task("convert-backend-translations", function () {
|
||||
return gulp
|
||||
.src([`${inDirBackend}/*.json`])
|
||||
.pipe(transform((data, file) => convertBackendTranslations(data, file)))
|
||||
.pipe(gulp.dest(inDirBackend));
|
||||
.pipe(gulp.dest(`${inDirBackend}/converted`));
|
||||
});
|
||||
|
||||
gulp.task("check-translations-html", function () {
|
||||
|
@ -10,5 +10,15 @@ export const callExecuteScript = (
|
||||
sequence,
|
||||
});
|
||||
|
||||
export const serviceCallWillDisconnect = (domain: string, service: string) =>
|
||||
domain === "homeassistant" && ["restart", "stop"].includes(service);
|
||||
export const serviceCallWillDisconnect = (
|
||||
domain: string,
|
||||
service: string,
|
||||
serviceData?: Record<string, any>
|
||||
) =>
|
||||
(domain === "homeassistant" && ["restart", "stop"].includes(service)) ||
|
||||
(domain === "update" &&
|
||||
service === "install" &&
|
||||
[
|
||||
"update.home_assistant_core_update",
|
||||
"update.home_assistant_operating_system_update",
|
||||
].includes(serviceData?.entity_id));
|
||||
|
@ -152,7 +152,9 @@ export class HaServiceAction extends LitElement implements ActionElement {
|
||||
.required=${!this.hass.services[domain][service].response!
|
||||
.optional}
|
||||
.disabled=${this.disabled ||
|
||||
(!this._action.response_variable && !this._responseChecked)}
|
||||
(this.hass.services[domain][service].response!.optional &&
|
||||
!this._action.response_variable &&
|
||||
!this._responseChecked)}
|
||||
@change=${this._responseVariableChanged}
|
||||
></ha-textfield>
|
||||
</ha-settings-row>`
|
||||
|
@ -100,7 +100,7 @@ export const connectionMixin = <T extends Constructor<HassBaseEl>>(
|
||||
} catch (err: any) {
|
||||
if (
|
||||
err.error?.code === ERR_CONNECTION_LOST &&
|
||||
serviceCallWillDisconnect(domain, service)
|
||||
serviceCallWillDisconnect(domain, service, serviceData)
|
||||
) {
|
||||
return { context: { id: "" } };
|
||||
}
|
||||
@ -121,7 +121,12 @@ export const connectionMixin = <T extends Constructor<HassBaseEl>>(
|
||||
"ui.notification_toast.service_call_failed",
|
||||
"service",
|
||||
`${domain}/${service}`
|
||||
) + ` ${err.message}`;
|
||||
) +
|
||||
` ${
|
||||
err.message || err.error?.code === ERR_CONNECTION_LOST
|
||||
? "connection lost"
|
||||
: "unknown error"
|
||||
}`;
|
||||
fireEvent(this as any, "hass-notification", { message });
|
||||
throw err;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user