diff --git a/src/state/connection-mixin.ts b/src/state/connection-mixin.ts index e578f2b230e1..01cd4985c754 100644 --- a/src/state/connection-mixin.ts +++ b/src/state/connection-mixin.ts @@ -122,16 +122,14 @@ export const connectionMixin = >( } if (notifyOnError) { forwardHaptic("failure"); - const lokalize = await this.hass?.loadBackendTranslation( + const lokalize = await this.hass!.loadBackendTranslation( "exceptions", domain ); - const localizedErrorMessage = - lokalize && - lokalize( - `component.${err.translation_domain}.exceptions.${err.translation_key}.message`, - err.translation_placeholders - ); + const localizedErrorMessage = lokalize( + `component.${err.translation_domain}.exceptions.${err.translation_key}.message`, + err.translation_placeholders + ); const message = localizedErrorMessage || (this as any).hass.localize(