mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Add reload for platforms with reload service (#6851)
This commit is contained in:
parent
100ba8edfa
commit
6e0e169b6e
@ -23,6 +23,8 @@ import { HomeAssistant, Route } from "../../../types";
|
|||||||
import "../ha-config-section";
|
import "../ha-config-section";
|
||||||
import { configSections } from "../ha-panel-config";
|
import { configSections } from "../ha-panel-config";
|
||||||
|
|
||||||
|
const platformsWithReload = ["template"];
|
||||||
|
|
||||||
@customElement("ha-config-server-control")
|
@customElement("ha-config-server-control")
|
||||||
export class HaConfigServerControl extends LitElement {
|
export class HaConfigServerControl extends LitElement {
|
||||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||||
@ -49,11 +51,13 @@ export class HaConfigServerControl extends LitElement {
|
|||||||
changedProperties.has("hass") &&
|
changedProperties.has("hass") &&
|
||||||
(!oldHass || oldHass.config.components !== this.hass.config.components)
|
(!oldHass || oldHass.config.components !== this.hass.config.components)
|
||||||
) {
|
) {
|
||||||
this._reloadableDomains = this.hass.config.components.filter(
|
this._reloadableDomains = this.hass.config.components
|
||||||
(component) =>
|
.concat(platformsWithReload)
|
||||||
!component.includes(".") &&
|
.filter(
|
||||||
isServiceLoaded(this.hass, component, "reload")
|
(component) =>
|
||||||
);
|
!component.includes(".") &&
|
||||||
|
isServiceLoaded(this.hass, component, "reload")
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user