Fix localize key error in developer tools & remove exception (#14045)

This commit is contained in:
Steve Repsher 2022-10-10 11:05:34 -04:00 committed by GitHub
parent c468fba36f
commit 1442f6d546
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 5 deletions

View File

@ -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}`

View File

@ -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 {
<mwc-button
class="warning"
@click=${this._restart}
.disabled=${this._validateLog}
.disabled=${!!this._validateLog}
>
${this.hass.localize(
"ui.panel.developer-tools.tabs.yaml.section.server_management.restart"