From 1442f6d546da4edf2363018188b6ccef1d77a209 Mon Sep 17 00:00:00 2001 From: Steve Repsher Date: Mon, 10 Oct 2022 11:05:34 -0400 Subject: [PATCH] Fix localize key error in developer tools & remove exception (#14045) --- src/common/translations/localize.ts | 1 - .../yaml_configuration/developer-yaml-config.ts | 13 +++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/common/translations/localize.ts b/src/common/translations/localize.ts index 5d6224d060..10080f0d1d 100644 --- a/src/common/translations/localize.ts +++ b/src/common/translations/localize.ts @@ -42,7 +42,6 @@ export type LocalizeKeys = | `ui.panel.config.url.${string}` | `ui.panel.config.zha.${string}` | `ui.panel.config.zwave_js.${string}` - | `ui.panel.developer-tools.tabs.${string}` | `ui.panel.lovelace.card.${string}` | `ui.panel.lovelace.editor.${string}` | `ui.panel.page-authorize.form.${string}` diff --git a/src/panels/developer-tools/yaml_configuration/developer-yaml-config.ts b/src/panels/developer-tools/yaml_configuration/developer-yaml-config.ts index 47ab1f4ff6..2e0f565916 100644 --- a/src/panels/developer-tools/yaml_configuration/developer-yaml-config.ts +++ b/src/panels/developer-tools/yaml_configuration/developer-yaml-config.ts @@ -9,7 +9,12 @@ import { checkCoreConfig } from "../../../data/core"; import { domainToName } from "../../../data/integration"; import { showConfirmationDialog } from "../../../dialogs/generic/show-dialog-box"; import { haStyle } from "../../../resources/styles"; -import type { HomeAssistant, Route } from "../../../types"; +import type { HomeAssistant, Route, TranslationDict } from "../../../types"; + +type ReloadableDomain = Exclude< + keyof TranslationDict["ui"]["panel"]["developer-tools"]["tabs"]["yaml"]["section"]["reloading"], + "heading" | "introduction" | "reload" +>; @customElement("developer-yaml-config") export class DeveloperYamlConfig extends LitElement { @@ -25,7 +30,7 @@ export class DeveloperYamlConfig extends LitElement { @state() private _validating = false; - @state() private _reloadableDomains: string[] = []; + @state() private _reloadableDomains: ReloadableDomain[] = []; @state() private _isValid: boolean | null = null; @@ -40,7 +45,7 @@ export class DeveloperYamlConfig extends LitElement { this._reloadableDomains = componentsWithService( this.hass, "reload" - ).sort(); + ).sort() as ReloadableDomain[]; } } @@ -97,7 +102,7 @@ export class DeveloperYamlConfig extends LitElement { ${this.hass.localize( "ui.panel.developer-tools.tabs.yaml.section.server_management.restart"