mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-22 16:56:35 +00:00
Limit setting up supervisor subscriptions to the supervisor panel (#10680)
This commit is contained in:
parent
d28ad17135
commit
3d99b92c07
@ -10,7 +10,7 @@ import { HassioPanelInfo } from "../../src/data/hassio/supervisor";
|
|||||||
import { Supervisor } from "../../src/data/supervisor/supervisor";
|
import { Supervisor } from "../../src/data/supervisor/supervisor";
|
||||||
import { makeDialogManager } from "../../src/dialogs/make-dialog-manager";
|
import { makeDialogManager } from "../../src/dialogs/make-dialog-manager";
|
||||||
import "../../src/layouts/hass-loading-screen";
|
import "../../src/layouts/hass-loading-screen";
|
||||||
import { HomeAssistant, Route } from "../../src/types";
|
import { HomeAssistant } from "../../src/types";
|
||||||
import "./hassio-router";
|
import "./hassio-router";
|
||||||
import { SupervisorBaseElement } from "./supervisor-base-element";
|
import { SupervisorBaseElement } from "./supervisor-base-element";
|
||||||
|
|
||||||
@ -24,8 +24,6 @@ export class HassioMain extends SupervisorBaseElement {
|
|||||||
|
|
||||||
@property({ type: Boolean }) public narrow!: boolean;
|
@property({ type: Boolean }) public narrow!: boolean;
|
||||||
|
|
||||||
@property({ attribute: false }) public route?: Route;
|
|
||||||
|
|
||||||
protected firstUpdated(changedProps: PropertyValues) {
|
protected firstUpdated(changedProps: PropertyValues) {
|
||||||
super.firstUpdated(changedProps);
|
super.firstUpdated(changedProps);
|
||||||
|
|
||||||
|
@ -25,7 +25,7 @@ import {
|
|||||||
} from "../../src/data/supervisor/supervisor";
|
} from "../../src/data/supervisor/supervisor";
|
||||||
import { ProvideHassLitMixin } from "../../src/mixins/provide-hass-lit-mixin";
|
import { ProvideHassLitMixin } from "../../src/mixins/provide-hass-lit-mixin";
|
||||||
import { urlSyncMixin } from "../../src/state/url-sync-mixin";
|
import { urlSyncMixin } from "../../src/state/url-sync-mixin";
|
||||||
import { HomeAssistant } from "../../src/types";
|
import { HomeAssistant, Route } from "../../src/types";
|
||||||
import { getTranslation } from "../../src/util/common-translation";
|
import { getTranslation } from "../../src/util/common-translation";
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
@ -38,6 +38,8 @@ declare global {
|
|||||||
export class SupervisorBaseElement extends urlSyncMixin(
|
export class SupervisorBaseElement extends urlSyncMixin(
|
||||||
ProvideHassLitMixin(LitElement)
|
ProvideHassLitMixin(LitElement)
|
||||||
) {
|
) {
|
||||||
|
@property({ attribute: false }) public route?: Route;
|
||||||
|
|
||||||
@property({ attribute: false }) public supervisor: Partial<Supervisor> = {
|
@property({ attribute: false }) public supervisor: Partial<Supervisor> = {
|
||||||
localize: () => "",
|
localize: () => "",
|
||||||
};
|
};
|
||||||
@ -108,7 +110,9 @@ export class SupervisorBaseElement extends urlSyncMixin(
|
|||||||
this._language = this.hass.language;
|
this._language = this.hass.language;
|
||||||
}
|
}
|
||||||
this._initializeLocalize();
|
this._initializeLocalize();
|
||||||
this._initSupervisor();
|
if (this.route?.prefix === "/hassio") {
|
||||||
|
this._initSupervisor();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private async _initializeLocalize() {
|
private async _initializeLocalize() {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user