mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-26 10:46:35 +00:00
Guard more of the hardware panel (#13650)
This commit is contained in:
parent
fd431f36f7
commit
bf5589b88d
@ -80,7 +80,8 @@ class HaConfigHardware extends SubscribeMixin(LitElement) {
|
|||||||
private _cpuEntries: { x: number; y: number | null }[] = [];
|
private _cpuEntries: { x: number; y: number | null }[] = [];
|
||||||
|
|
||||||
public hassSubscribe() {
|
public hassSubscribe() {
|
||||||
return [
|
return isComponentLoaded(this.hass, "hardware")
|
||||||
|
? [
|
||||||
this.hass.connection.subscribeMessage<SystemStatusStreamMessage>(
|
this.hass.connection.subscribeMessage<SystemStatusStreamMessage>(
|
||||||
(message) => {
|
(message) => {
|
||||||
// Only store the last 60 entries
|
// Only store the last 60 entries
|
||||||
@ -102,7 +103,8 @@ class HaConfigHardware extends SubscribeMixin(LitElement) {
|
|||||||
type: "hardware/subscribe_system_status",
|
type: "hardware/subscribe_system_status",
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
];
|
]
|
||||||
|
: [];
|
||||||
}
|
}
|
||||||
|
|
||||||
protected willUpdate(): void {
|
protected willUpdate(): void {
|
||||||
@ -198,7 +200,8 @@ class HaConfigHardware extends SubscribeMixin(LitElement) {
|
|||||||
.narrow=${this.narrow}
|
.narrow=${this.narrow}
|
||||||
.header=${this.hass.localize("ui.panel.config.hardware.caption")}
|
.header=${this.hass.localize("ui.panel.config.hardware.caption")}
|
||||||
>
|
>
|
||||||
<ha-button-menu corner="BOTTOM_START" slot="toolbar-icon">
|
${isComponentLoaded(this.hass, "hassio")
|
||||||
|
? html`<ha-button-menu corner="BOTTOM_START" slot="toolbar-icon">
|
||||||
<ha-icon-button
|
<ha-icon-button
|
||||||
.label=${this.hass.localize("ui.common.menu")}
|
.label=${this.hass.localize("ui.common.menu")}
|
||||||
.path=${mdiDotsVertical}
|
.path=${mdiDotsVertical}
|
||||||
@ -223,7 +226,8 @@ class HaConfigHardware extends SubscribeMixin(LitElement) {
|
|||||||
>
|
>
|
||||||
`
|
`
|
||||||
: ""}
|
: ""}
|
||||||
</ha-button-menu>
|
</ha-button-menu>`
|
||||||
|
: ""}
|
||||||
${this._error
|
${this._error
|
||||||
? html`
|
? html`
|
||||||
<ha-alert alert-type="error"
|
<ha-alert alert-type="error"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user