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