Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/panels/config/entities/dialog-entity-editor.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
import "@material/mwc-tab-bar";
import "@material/mwc-tab";
import "@material/mwc-icon-button";
import "@material/mwc-tab";
import "@material/mwc-tab-bar";
import { mdiClose, mdiTune } from "@mdi/js";
import { HassEntity } from "home-assistant-js-websocket";
import {
css,
CSSResult,
customElement,
html,
internalProperty,
LitElement,
property,
internalProperty,
TemplateResult,
} from "lit-element";
import { cache } from "lit-html/directives/cache";
import { fireEvent } from "../../../common/dom/fire_event";
import { dynamicElement } from "../../../common/dom/dynamic-element-directive";
import { fireEvent } from "../../../common/dom/fire_event";
import { computeStateName } from "../../../common/entity/compute_state_name";
import "../../../components/ha-dialog";
import "../../../components/ha-header-bar";
import "../../../components/ha-svg-icon";
import "../../../components/ha-related-items";
import "../../../components/ha-svg-icon";
import {
EntityRegistryEntry,
ExtEntityRegistryEntry,
Expand All @@ -30,7 +31,6 @@ import type { HomeAssistant } from "../../../types";
import { PLATFORMS_WITH_SETTINGS_TAB } from "./const";
import "./entity-registry-settings";
import type { EntityRegistryDetailDialogParams } from "./show-dialog-entity-editor";
import { mdiClose, mdiTune } from "@mdi/js";

interface Tabs {
[key: string]: Tab;
Expand Down Expand Up @@ -252,7 +252,7 @@ export class DialogEntityEditor extends LitElement {

@media all and (min-width: 451px) and (min-height: 501px) {
.wrapper {
width: 400px;
min-width: 400px;
}
}

Expand Down
81 changes: 39 additions & 42 deletions src/panels/config/server_control/ha-config-server-control.ts
Original file line number Diff line number Diff line change
@@ -1,55 +1,27 @@
import "@material/mwc-button";
import "@polymer/app-layout/app-header/app-header";
import "@polymer/app-layout/app-toolbar/app-toolbar";
import "../../../layouts/hass-tabs-subpage";
import { configSections } from "../ha-panel-config";
import "@polymer/paper-input/paper-input";
import {
LitElement,
property,
internalProperty,
customElement,
html,
css,
CSSResult,
customElement,
html,
internalProperty,
LitElement,
property,
TemplateResult,
} from "lit-element";
import { HomeAssistant, Route } from "../../../types";

import "@material/mwc-button";
import "@polymer/paper-input/paper-input";
import { isServiceLoaded } from "../../../common/config/is_service_loaded";
import "../../../components/buttons/ha-call-service-button";
import "../../../components/ha-card";
import "../ha-config-section";
import { haStyle } from "../../../resources/styles";
import { checkCoreConfig } from "../../../data/core";

const reloadableDomains = [
"group",
"automation",
"script",
"scene",
"person",
"zone",
"input_boolean",
"input_text",
"input_number",
"input_datetime",
"input_select",
"template",
"universal",
"rest",
"command_line",
"filter",
"statistics",
"generic",
"generic_thermostat",
"homekit",
"min_max",
"history_stats",
"trend",
"ping",
"filesize",
];
import { domainToName } from "../../../data/integration";
import "../../../layouts/hass-tabs-subpage";
import { haStyle } from "../../../resources/styles";
import { HomeAssistant, Route } from "../../../types";
import "../ha-config-section";
import { configSections } from "../ha-panel-config";

@customElement("ha-config-server-control")
export class HaConfigServerControl extends LitElement {
Expand All @@ -65,10 +37,26 @@ export class HaConfigServerControl extends LitElement {

@internalProperty() private _validating = false;

@internalProperty() private _reloadableDomains: string[] = [];

private _validateLog = "";

private _isValid: boolean | null = null;

protected updated(changedProperties) {
const oldHass = changedProperties.get("hass");
if (
changedProperties.has("hass") &&
(!oldHass || oldHass.config.components !== this.hass.config.components)
) {
this._reloadableDomains = this.hass.config.components.filter(
(component) =>
!component.includes(".") &&
isServiceLoaded(this.hass, component, "reload")
);
}
}

protected render(): TemplateResult {
return html`
<hass-tabs-subpage
Expand Down Expand Up @@ -215,7 +203,7 @@ export class HaConfigServerControl extends LitElement {
)}
</ha-call-service-button>
</div>
${reloadableDomains.map((domain) =>
${this._reloadableDomains.map((domain) =>
isServiceLoaded(this.hass, domain, "reload")
? html`<div class="card-actions">
<ha-call-service-button
Expand All @@ -224,6 +212,11 @@ export class HaConfigServerControl extends LitElement {
service="reload"
>${this.hass.localize(
`ui.panel.config.server_control.section.reloading.${domain}`
) ||
this.hass.localize(
"ui.panel.config.server_control.section.reloading.reload",
"domain",
domainToName(this.hass.localize, domain)
)}
</ha-call-service-button>
</div>`
Expand Down Expand Up @@ -282,6 +275,10 @@ export class HaConfigServerControl extends LitElement {
white-space: pre-wrap;
direction: ltr;
}

ha-config-section {
padding-bottom: 24px;
}
`,
];
}
Expand Down
28 changes: 2 additions & 26 deletions src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -827,32 +827,8 @@
"reloading": {
"heading": "YAML configuration reloading",
"introduction": "Some parts of Home Assistant can reload without requiring a restart. Hitting reload will unload their current YAML configuration and load the new one.",
"core": "Reload location & customizations",
"group": "Reload groups",
"automation": "Reload automations",
"script": "Reload scripts",
"scene": "Reload scenes",
"person": "Reload persons",
"zone": "Reload zones",
"input_boolean": "Reload input booleans",
"input_text": "Reload input texts",
"input_number": "Reload input numbers",
"input_datetime": "Reload input date times",
"input_select": "Reload input selects",
"template": "Reload template entities",
"universal": "Reload universal media player entities",
"rest": "Reload rest entities",
"command_line": "Reload command line entities",
"filter": "Reload filter entities",
"statistics": "Reload statistics entities",
"generic": "Reload generic IP camera entities",
"generic_thermostat": "Reload generic thermostat entities",
"homekit": "Reload HomeKit",
"min_max": "Reload min/max entities",
"history_stats": "Reload history stats entities",
"trend": "Reload trend entities",
"ping": "Reload ping binary sensor entities",
"filesize": "Reload file size entities"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we keep the translations that do not result in an identical string?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah we can, should we leave all in? They all are slightly different I think, mainly because of plurals

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, why not.
We can always change it / remove some in the future.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bramkragten if possible please add rpi_gpio to the translations (https://github.com/home-assistant/frontend/pull/6764/files#diff-571ce32a17d6aa22fdd0942224a8ff44R856)

"rpi_gpio": "Reload Raspberry Pi GPIO entities"

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does it say now?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it needs to change, please create a PR

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

currently, there is no rpi_gpio entry.
I'll check how this looks and if needed create a new PR.

"reload": "Reload {domain}",
"core": "Reload location & customizations"
},
"server_management": {
"heading": "Server management",
Expand Down