From 507f22a5cd01a334ab08a4db0b609d3db6fa67ae Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Wed, 5 Jul 2023 16:49:35 +0200 Subject: [PATCH 1/3] Update of core or OS will disconnect (#17170) --- src/data/service.ts | 14 ++++++++++++-- src/state/connection-mixin.ts | 9 +++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/data/service.ts b/src/data/service.ts index f93312ecf2..70b05a2f14 100644 --- a/src/data/service.ts +++ b/src/data/service.ts @@ -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 +) => + (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)); diff --git a/src/state/connection-mixin.ts b/src/state/connection-mixin.ts index c2c81cc87f..8ba5091a02 100644 --- a/src/state/connection-mixin.ts +++ b/src/state/connection-mixin.ts @@ -100,7 +100,7 @@ export const connectionMixin = >( } 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 = >( "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; } From ad8d3c7fa8193a39eb80dfba741dc1e02022c3cf Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Wed, 5 Jul 2023 16:53:19 +0200 Subject: [PATCH 2/3] Fix non optional response service, variable field disabled (#17171) --- .../automation/action/types/ha-automation-action-service.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/panels/config/automation/action/types/ha-automation-action-service.ts b/src/panels/config/automation/action/types/ha-automation-action-service.ts index 0c403a13dd..ed8868b099 100644 --- a/src/panels/config/automation/action/types/ha-automation-action-service.ts +++ b/src/panels/config/automation/action/types/ha-automation-action-service.ts @@ -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} > ` From cc8ab184e332bb7734859242e2f1f9c91885176a Mon Sep 17 00:00:00 2001 From: Bram Kragten Date: Wed, 5 Jul 2023 17:05:13 +0200 Subject: [PATCH 3/3] Update download-translations.js --- build-scripts/gulp/download-translations.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-scripts/gulp/download-translations.js b/build-scripts/gulp/download-translations.js index 36be7fae80..d7b3a9e853 100644 --- a/build-scripts/gulp/download-translations.js +++ b/build-scripts/gulp/download-translations.js @@ -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 () {