diff --git a/hassio/src/dashboard/hassio-addons.ts b/hassio/src/dashboard/hassio-addons.ts
index 717a6397a3..a28c7c1da8 100644
--- a/hassio/src/dashboard/hassio-addons.ts
+++ b/hassio/src/dashboard/hassio-addons.ts
@@ -12,7 +12,7 @@ import { atLeastVersion } from "../../../src/common/config/version";
import { navigate } from "../../../src/common/navigate";
import { compare } from "../../../src/common/string/compare";
import "../../../src/components/ha-card";
-import { HassioAddonInfo } from "../../../src/data/hassio/addon";
+import { Supervisor } from "../../../src/data/supervisor/supervisor";
import { haStyle } from "../../../src/resources/styles";
import { HomeAssistant } from "../../../src/types";
import "../components/hassio-card-content";
@@ -22,14 +22,14 @@ import { hassioStyle } from "../resources/hassio-style";
class HassioAddons extends LitElement {
@property({ attribute: false }) public hass!: HomeAssistant;
- @property({ attribute: false }) public addons?: HassioAddonInfo[];
+ @property({ attribute: false }) public supervisor!: Supervisor;
protected render(): TemplateResult {
return html`
Add-ons
- ${!this.addons?.length
+ ${!this.supervisor.supervisor.addons?.length
? html`
@@ -41,7 +41,7 @@ class HassioAddons extends LitElement {
`
- : this.addons
+ : this.supervisor.supervisor.addons
.sort((a, b) => compare(a.name, b.name))
.map(
(addon) => html`
diff --git a/hassio/src/dashboard/hassio-dashboard.ts b/hassio/src/dashboard/hassio-dashboard.ts
index 650d1084a0..d2dac17237 100644
--- a/hassio/src/dashboard/hassio-dashboard.ts
+++ b/hassio/src/dashboard/hassio-dashboard.ts
@@ -7,11 +7,7 @@ import {
property,
TemplateResult,
} from "lit-element";
-import { HassioHassOSInfo } from "../../../src/data/hassio/host";
-import {
- HassioHomeAssistantInfo,
- HassioSupervisorInfo,
-} from "../../../src/data/hassio/supervisor";
+import { Supervisor } from "../../../src/data/supervisor/supervisor";
import "../../../src/layouts/hass-tabs-subpage";
import { haStyle } from "../../../src/resources/styles";
import { HomeAssistant, Route } from "../../../src/types";
@@ -23,16 +19,12 @@ import "./hassio-update";
class HassioDashboard extends LitElement {
@property({ attribute: false }) public hass!: HomeAssistant;
+ @property({ attribute: false }) public supervisor!: Supervisor;
+
@property({ type: Boolean }) public narrow!: boolean;
@property({ attribute: false }) public route!: Route;
- @property({ attribute: false }) public supervisorInfo!: HassioSupervisorInfo;
-
- @property({ attribute: false }) public hassInfo!: HassioHomeAssistantInfo;
-
- @property({ attribute: false }) public hassOsInfo!: HassioHassOSInfo;
-
protected render(): TemplateResult {
return html`
diff --git a/hassio/src/dashboard/hassio-update.ts b/hassio/src/dashboard/hassio-update.ts
index 9f8fa97d37..b8d9cef96b 100644
--- a/hassio/src/dashboard/hassio-update.ts
+++ b/hassio/src/dashboard/hassio-update.ts
@@ -23,6 +23,7 @@ import {
HassioHomeAssistantInfo,
HassioSupervisorInfo,
} from "../../../src/data/hassio/supervisor";
+import { Supervisor } from "../../../src/data/supervisor/supervisor";
import {
showAlertDialog,
showConfirmationDialog,
@@ -35,31 +36,20 @@ import { hassioStyle } from "../resources/hassio-style";
export class HassioUpdate extends LitElement {
@property({ attribute: false }) public hass!: HomeAssistant;
- @property({ attribute: false }) public hassInfo?: HassioHomeAssistantInfo;
+ @property({ attribute: false }) public supervisor!: Supervisor;
- @property({ attribute: false }) public hassOsInfo?: HassioHassOSInfo;
-
- @property({ attribute: false }) public supervisorInfo?: HassioSupervisorInfo;
-
- private _pendingUpdates = memoizeOne(
- (
- core?: HassioHomeAssistantInfo,
- supervisor?: HassioSupervisorInfo,
- os?: HassioHassOSInfo
- ): number => {
- return [core, supervisor, os].filter(
- (value) => !!value && value?.update_available
- ).length;
- }
- );
+ private _pendingUpdates = memoizeOne((supervisor: Supervisor): number => {
+ return Object.keys(supervisor).filter(
+ (value) => supervisor[value].update_available
+ ).length;
+ });
protected render(): TemplateResult {
- const updatesAvailable = this._pendingUpdates(
- this.hassInfo,
- this.supervisorInfo,
- this.hassOsInfo
- );
+ if (!this.supervisor) {
+ return html``;
+ }
+ const updatesAvailable = this._pendingUpdates(this.supervisor);
if (!updatesAvailable) {
return html``;
}
@@ -74,26 +64,26 @@ export class HassioUpdate extends LitElement {
${this._renderUpdateCard(
"Home Assistant Core",
- this.hassInfo!,
+ this.supervisor.core,
"hassio/homeassistant/update",
`https://${
- this.hassInfo?.version_latest.includes("b") ? "rc" : "www"
+ this.supervisor.core.version_latest.includes("b") ? "rc" : "www"
}.home-assistant.io/latest-release-notes/`
)}
${this._renderUpdateCard(
"Supervisor",
- this.supervisorInfo!,
+ this.supervisor.supervisor,
"hassio/supervisor/update",
`https://github.com//home-assistant/hassio/releases/tag/${
- this.supervisorInfo!.version_latest
+ this.supervisor.supervisor.version_latest
}`
)}
- ${this.hassOsInfo
+ ${this.supervisor.host.features.includes("hassos")
? this._renderUpdateCard(
"Operating System",
- this.hassOsInfo,
+ this.supervisor.os,
"hassio/os/update",
- `https://github.com//home-assistant/hassos/releases/tag/${this.hassOsInfo.version_latest}`
+ `https://github.com//home-assistant/hassos/releases/tag/${this.supervisor.os.version_latest}`
)
: ""}
diff --git a/hassio/src/hassio-main.ts b/hassio/src/hassio-main.ts
index ccabb2e426..2ee909885e 100644
--- a/hassio/src/hassio-main.ts
+++ b/hassio/src/hassio-main.ts
@@ -1,29 +1,22 @@
-import {
- html,
- PropertyValues,
- customElement,
- LitElement,
- property,
-} from "lit-element";
+import { html, PropertyValues, customElement, property } from "lit-element";
import "./hassio-router";
-import { urlSyncMixin } from "../../src/state/url-sync-mixin";
-import { ProvideHassLitMixin } from "../../src/mixins/provide-hass-lit-mixin";
import { HomeAssistant, Route } from "../../src/types";
import { HassioPanelInfo } from "../../src/data/hassio/supervisor";
import { applyThemesOnElement } from "../../src/common/dom/apply_themes_on_element";
import { fireEvent } from "../../src/common/dom/fire_event";
import { makeDialogManager } from "../../src/dialogs/make-dialog-manager";
import { atLeastVersion } from "../../src/common/config/version";
+import { SupervisorBaseElement } from "./supervisor-base-element";
@customElement("hassio-main")
-export class HassioMain extends urlSyncMixin(ProvideHassLitMixin(LitElement)) {
+export class HassioMain extends SupervisorBaseElement {
@property({ attribute: false }) public hass!: HomeAssistant;
- @property() public panel!: HassioPanelInfo;
+ @property({ attribute: false }) public panel!: HassioPanelInfo;
- @property() public narrow!: boolean;
+ @property({ type: Boolean }) public narrow!: boolean;
- @property() public route?: Route;
+ @property({ attribute: false }) public route?: Route;
protected firstUpdated(changedProps: PropertyValues) {
super.firstUpdated(changedProps);
@@ -77,9 +70,13 @@ export class HassioMain extends urlSyncMixin(ProvideHassLitMixin(LitElement)) {
}
protected render() {
+ if (!this.supervisor || !this.hass) {
+ return html``;
+ }
return html`
`;
}
diff --git a/hassio/src/hassio-router.ts b/hassio/src/hassio-router.ts
index 71e4315fa8..50bd69cd3a 100644
--- a/hassio/src/hassio-router.ts
+++ b/hassio/src/hassio-router.ts
@@ -1,24 +1,6 @@
-import {
- customElement,
- property,
- internalProperty,
- PropertyValues,
-} from "lit-element";
-import {
- fetchHassioHassOsInfo,
- fetchHassioHostInfo,
- HassioHassOSInfo,
- HassioHostInfo,
-} from "../../src/data/hassio/host";
-import {
- fetchHassioHomeAssistantInfo,
- fetchHassioSupervisorInfo,
- fetchHassioInfo,
- HassioHomeAssistantInfo,
- HassioInfo,
- HassioPanelInfo,
- HassioSupervisorInfo,
-} from "../../src/data/hassio/supervisor";
+import { customElement, property } from "lit-element";
+import { HassioPanelInfo } from "../../src/data/hassio/supervisor";
+import { Supervisor } from "../../src/data/supervisor/supervisor";
import {
HassRouterPage,
RouterOptions,
@@ -32,9 +14,11 @@ import "./hassio-panel";
class HassioRouter extends HassRouterPage {
@property({ attribute: false }) public hass!: HomeAssistant;
- @property() public panel!: HassioPanelInfo;
+ @property({ attribute: false }) public supervisor!: Supervisor;
- @property() public narrow!: boolean;
+ @property({ attribute: false }) public panel!: HassioPanelInfo;
+
+ @property({ type: Boolean }) public narrow!: boolean;
protected routerOptions: RouterOptions = {
// Hass.io has a page with tabs, so we route all non-matching routes to it.
@@ -60,32 +44,13 @@ class HassioRouter extends HassRouterPage {
},
};
- @internalProperty() private _supervisorInfo?: HassioSupervisorInfo;
-
- @internalProperty() private _hostInfo?: HassioHostInfo;
-
- @internalProperty() private _hassioInfo?: HassioInfo;
-
- @internalProperty() private _hassOsInfo?: HassioHassOSInfo;
-
- @internalProperty() private _hassInfo?: HassioHomeAssistantInfo;
-
- protected firstUpdated(changedProps: PropertyValues) {
- super.firstUpdated(changedProps);
- this.addEventListener("hass-api-called", (ev) => this._apiCalled(ev));
- }
-
protected updatePageEl(el) {
// the tabs page does its own routing so needs full route.
const route = el.nodeName === "HASSIO-PANEL" ? this.route : this.routeTail;
el.hass = this.hass;
+ el.supervisor = this.supervisor;
el.narrow = this.narrow;
- el.supervisorInfo = this._supervisorInfo;
- el.hassioInfo = this._hassioInfo;
- el.hostInfo = this._hostInfo;
- el.hassInfo = this._hassInfo;
- el.hassOsInfo = this._hassOsInfo;
el.route = route;
if (el.localName === "hassio-ingress-view") {
@@ -96,45 +61,12 @@ class HassioRouter extends HassRouterPage {
private async _fetchData() {
if (this.panel.config && this.panel.config.ingress) {
this._redirectIngress(this.panel.config.ingress);
- return;
- }
-
- const [supervisorInfo, hostInfo, hassInfo, hassioInfo] = await Promise.all([
- fetchHassioSupervisorInfo(this.hass),
- fetchHassioHostInfo(this.hass),
- fetchHassioHomeAssistantInfo(this.hass),
- fetchHassioInfo(this.hass),
- ]);
- this._supervisorInfo = supervisorInfo;
- this._hassioInfo = hassioInfo;
- this._hostInfo = hostInfo;
- this._hassInfo = hassInfo;
-
- if (this._hostInfo.features && this._hostInfo.features.includes("hassos")) {
- this._hassOsInfo = await fetchHassioHassOsInfo(this.hass);
}
}
private _redirectIngress(addonSlug: string) {
this.route = { prefix: "/hassio", path: `/ingress/${addonSlug}` };
}
-
- private _apiCalled(ev) {
- if (!ev.detail.success) {
- return;
- }
-
- let tries = 1;
-
- const tryUpdate = () => {
- this._fetchData().catch(() => {
- tries += 1;
- setTimeout(tryUpdate, Math.min(tries, 5) * 1000);
- });
- };
-
- tryUpdate();
- }
}
declare global {
diff --git a/hassio/src/snapshots/hassio-snapshots.ts b/hassio/src/snapshots/hassio-snapshots.ts
index 96dd6caecf..d156f567a9 100644
--- a/hassio/src/snapshots/hassio-snapshots.ts
+++ b/hassio/src/snapshots/hassio-snapshots.ts
@@ -26,7 +26,6 @@ import {
TemplateResult,
} from "lit-element";
import { atLeastVersion } from "../../../src/common/config/version";
-import { fireEvent } from "../../../src/common/dom/fire_event";
import "../../../src/components/buttons/ha-progress-button";
import "../../../src/components/ha-button-menu";
import "../../../src/components/ha-card";
@@ -41,7 +40,7 @@ import {
HassioSnapshot,
reloadHassioSnapshots,
} from "../../../src/data/hassio/snapshot";
-import { HassioSupervisorInfo } from "../../../src/data/hassio/supervisor";
+import { Supervisor } from "../../../src/data/supervisor/supervisor";
import "../../../src/layouts/hass-tabs-subpage";
import { PolymerChangedEvent } from "../../../src/polymer-types";
import { haStyle } from "../../../src/resources/styles";
@@ -67,7 +66,7 @@ class HassioSnapshots extends LitElement {
@property({ attribute: false }) public route!: Route;
- @property({ attribute: false }) public supervisorInfo!: HassioSupervisorInfo;
+ @property({ attribute: false }) public supervisor!: Supervisor;
@internalProperty() private _snapshotName = "";
@@ -266,7 +265,7 @@ class HassioSnapshots extends LitElement {
protected updated(changedProps: PropertyValues) {
if (changedProps.has("supervisorInfo")) {
- this._addonList = this.supervisorInfo.addons
+ this._addonList = this.supervisor.supervisor.addons
.map((addon) => ({
slug: addon.slug,
name: addon.name,
@@ -372,7 +371,6 @@ class HassioSnapshots extends LitElement {
await createHassioPartialSnapshot(this.hass, data);
}
this._updateSnapshots();
- fireEvent(this, "hass-api-called", { success: true, response: null });
} catch (err) {
this._error = extractApiErrorMessage(err);
}
diff --git a/hassio/src/supervisor-base-element.ts b/hassio/src/supervisor-base-element.ts
new file mode 100644
index 0000000000..b6b301175a
--- /dev/null
+++ b/hassio/src/supervisor-base-element.ts
@@ -0,0 +1,69 @@
+import { LitElement, property, PropertyValues } from "lit-element";
+import {
+ fetchHassioHassOsInfo,
+ fetchHassioHostInfo,
+} from "../../src/data/hassio/host";
+import { fetchNetworkInfo } from "../../src/data/hassio/network";
+import { fetchHassioResolution } from "../../src/data/hassio/resolution";
+import {
+ fetchHassioHomeAssistantInfo,
+ fetchHassioInfo,
+ fetchHassioSupervisorInfo,
+} from "../../src/data/hassio/supervisor";
+import { Supervisor } from "../../src/data/supervisor/supervisor";
+import { ProvideHassLitMixin } from "../../src/mixins/provide-hass-lit-mixin";
+import { urlSyncMixin } from "../../src/state/url-sync-mixin";
+
+declare global {
+ interface HASSDomEvents {
+ "supervisor-update": Partial;
+ }
+}
+
+export class SupervisorBaseElement extends urlSyncMixin(
+ ProvideHassLitMixin(LitElement)
+) {
+ @property({ attribute: false }) public supervisor?: Supervisor;
+
+ protected _updateSupervisor(obj: Partial): void {
+ this.supervisor = { ...this.supervisor!, ...obj };
+ }
+
+ protected firstUpdated(changedProps: PropertyValues): void {
+ super.firstUpdated(changedProps);
+ this._initSupervisor();
+ this.addEventListener("supervisor-update", (ev) =>
+ this._updateSupervisor(ev.detail)
+ );
+ }
+
+ private async _initSupervisor(): Promise {
+ const [
+ supervisor,
+ host,
+ core,
+ info,
+ os,
+ network,
+ resolution,
+ ] = await Promise.all([
+ fetchHassioSupervisorInfo(this.hass),
+ fetchHassioHostInfo(this.hass),
+ fetchHassioHomeAssistantInfo(this.hass),
+ fetchHassioInfo(this.hass),
+ fetchHassioHassOsInfo(this.hass),
+ fetchNetworkInfo(this.hass),
+ fetchHassioResolution(this.hass),
+ ]);
+
+ this.supervisor = {
+ supervisor,
+ host,
+ core,
+ info,
+ os,
+ network,
+ resolution,
+ };
+ }
+}
diff --git a/hassio/src/system/hassio-host-info.ts b/hassio/src/system/hassio-host-info.ts
index 0f96ae0ace..42b066c214 100644
--- a/hassio/src/system/hassio-host-info.ts
+++ b/hassio/src/system/hassio-host-info.ts
@@ -8,12 +8,12 @@ import {
CSSResult,
customElement,
html,
- internalProperty,
LitElement,
property,
TemplateResult,
} from "lit-element";
import memoizeOne from "memoize-one";
+import { fireEvent } from "../../../src/common/dom/fire_event";
import "../../../src/components/buttons/ha-progress-button";
import "../../../src/components/ha-button-menu";
import "../../../src/components/ha-card";
@@ -27,8 +27,6 @@ import {
changeHostOptions,
configSyncOS,
fetchHassioHostInfo,
- HassioHassOSInfo,
- HassioHostInfo as HassioHostInfoType,
rebootHost,
shutdownHost,
updateOS,
@@ -37,7 +35,7 @@ import {
fetchNetworkInfo,
NetworkInfo,
} from "../../../src/data/hassio/network";
-import { HassioInfo } from "../../../src/data/hassio/supervisor";
+import { Supervisor } from "../../../src/data/supervisor/supervisor";
import {
showAlertDialog,
showConfirmationDialog,
@@ -53,28 +51,22 @@ import { hassioStyle } from "../resources/hassio-style";
class HassioHostInfo extends LitElement {
@property({ attribute: false }) public hass!: HomeAssistant;
- @property({ attribute: false }) public hostInfo!: HassioHostInfoType;
-
- @property({ attribute: false }) public hassioInfo!: HassioInfo;
-
- @property({ attribute: false }) public hassOsInfo!: HassioHassOSInfo;
-
- @internalProperty() public _networkInfo?: NetworkInfo;
+ @property({ attribute: false }) public supervisor!: Supervisor;
protected render(): TemplateResult | void {
- const primaryIpAddress = this.hostInfo.features.includes("network")
- ? this._primaryIpAddress(this._networkInfo!)
+ const primaryIpAddress = this.supervisor.host.features.includes("network")
+ ? this._primaryIpAddress(this.supervisor.network!)
: "";
return html`
- ${this.hostInfo.features.includes("hostname")
+ ${this.supervisor.host.features.includes("hostname")
? html`
Hostname
- ${this.hostInfo.hostname}
+ ${this.supervisor.host.hostname}
`
: ""}
- ${this.hostInfo.features.includes("network")
+ ${this.supervisor.host.features.includes("network")
? html`
IP Address
@@ -106,10 +98,9 @@ class HassioHostInfo extends LitElement {
Operating System
- ${this.hostInfo.operating_system}
+ ${this.supervisor.host.operating_system}
- ${this.hostInfo.features.includes("hassos") &&
- this.hassOsInfo.update_available
+ ${this.supervisor.os.update_available
? html`
- ${!this.hostInfo.features.includes("hassos")
+ ${!this.supervisor.host.features.includes("hassos")
? html`
Docker version
- ${this.hassioInfo.docker}
+ ${this.supervisor.info.docker}
`
: ""}
- ${this.hostInfo.deployment
+ ${this.supervisor.host.deployment
? html`
Deployment
- ${this.hostInfo.deployment}
+ ${this.supervisor.host.deployment}
`
: ""}
- ${this.hostInfo.features.includes("reboot")
+ ${this.supervisor.host.features.includes("reboot")
? html`
`
: ""}
- ${this.hostInfo.features.includes("shutdown")
+ ${this.supervisor.host.features.includes("shutdown")
? html`
Hardware
- ${this.hostInfo.features.includes("hassos")
+ ${this.supervisor.host.features.includes("hassos")
? html`
@@ -314,13 +305,13 @@ class HassioHostInfo extends LitElement {
private async _changeNetworkClicked(): Promise {
showNetworkDialog(this, {
- network: this._networkInfo!,
+ network: this.supervisor.network!,
loadData: () => this._loadData(),
});
}
private async _changeHostnameClicked(): Promise {
- const curHostname: string = this.hostInfo.hostname;
+ const curHostname: string = this.supervisor.host.hostname;
const hostname = await showPromptDialog(this, {
title: "Change Hostname",
inputLabel: "Please enter a new hostname:",
@@ -331,7 +322,8 @@ class HassioHostInfo extends LitElement {
if (hostname && hostname !== curHostname) {
try {
await changeHostOptions(this.hass, { hostname });
- this.hostInfo = await fetchHassioHostInfo(this.hass);
+ const host = await fetchHassioHostInfo(this.hass);
+ fireEvent(this, "supervisor-update", { host });
} catch (err) {
showAlertDialog(this, {
title: "Setting hostname failed",
@@ -344,7 +336,8 @@ class HassioHostInfo extends LitElement {
private async _importFromUSB(): Promise {
try {
await configSyncOS(this.hass);
- this.hostInfo = await fetchHassioHostInfo(this.hass);
+ const host = await fetchHassioHostInfo(this.hass);
+ fireEvent(this, "supervisor-update", { host });
} catch (err) {
showAlertDialog(this, {
title: "Failed to import from USB",
@@ -354,7 +347,8 @@ class HassioHostInfo extends LitElement {
}
private async _loadData(): Promise {
- this._networkInfo = await fetchNetworkInfo(this.hass);
+ const network = await fetchNetworkInfo(this.hass);
+ fireEvent(this, "supervisor-update", { network });
}
static get styles(): CSSResult[] {
diff --git a/hassio/src/system/hassio-supervisor-info.ts b/hassio/src/system/hassio-supervisor-info.ts
index 9757a5b674..0394286d09 100644
--- a/hassio/src/system/hassio-supervisor-info.ts
+++ b/hassio/src/system/hassio-supervisor-info.ts
@@ -13,17 +13,15 @@ import "../../../src/components/ha-card";
import "../../../src/components/ha-settings-row";
import "../../../src/components/ha-switch";
import { extractApiErrorMessage } from "../../../src/data/hassio/common";
-import { HassioHostInfo as HassioHostInfoType } from "../../../src/data/hassio/host";
-import { fetchHassioResolution } from "../../../src/data/hassio/resolution";
import {
fetchHassioSupervisorInfo,
- HassioSupervisorInfo as HassioSupervisorInfoType,
reloadSupervisor,
restartSupervisor,
setSupervisorOption,
SupervisorOptions,
updateSupervisor,
} from "../../../src/data/hassio/supervisor";
+import { Supervisor } from "../../../src/data/supervisor/supervisor";
import {
showAlertDialog,
showConfirmationDialog,
@@ -87,15 +85,9 @@ const UNHEALTHY_REASON = {
class HassioSupervisorInfo extends LitElement {
@property({ attribute: false }) public hass!: HomeAssistant;
- @property({ attribute: false })
- public supervisorInfo!: HassioSupervisorInfoType;
-
- @property({ attribute: false }) public hostInfo!: HassioHostInfoType;
+ @property({ attribute: false }) public supervisor!: Supervisor;
protected render(): TemplateResult | void {
- if (!this.hass || !this.supervisorInfo || !this.hostInfo) {
- return html``;
- }
return html`
@@ -104,7 +96,7 @@ class HassioSupervisorInfo extends LitElement {
Version
- ${this.supervisorInfo.version}
+ ${this.supervisor.supervisor.version}
@@ -112,9 +104,9 @@ class HassioSupervisorInfo extends LitElement {
Newest Version
- ${this.supervisorInfo.version_latest}
+ ${this.supervisor.supervisor.version_latest}
- ${this.supervisorInfo.update_available
+ ${this.supervisor.supervisor.update_available
? html`
- ${this.supervisorInfo.channel}
+ ${this.supervisor.supervisor.channel}
- ${this.supervisorInfo.channel === "beta"
+ ${this.supervisor.supervisor.channel === "beta"
? html`
`
- : this.supervisorInfo.channel === "stable"
+ : this.supervisor.supervisor.channel === "stable"
? html`
- ${this.supervisorInfo.supported
+ ${this.supervisor.supervisor.supported
? html`
Share Diagnostics
@@ -170,7 +162,7 @@ class HassioSupervisorInfo extends LitElement {
`
@@ -184,7 +176,7 @@ class HassioSupervisorInfo extends LitElement {
Learn more
`}
- ${!this.supervisorInfo.healthy
+ ${!this.supervisor.supervisor.healthy
? html`
Your installtion is running in an unhealthy state.
diff --git a/src/data/hassio/host.ts b/src/data/hassio/host.ts
index ebdc606832..10af5955f8 100644
--- a/src/data/hassio/host.ts
+++ b/src/data/hassio/host.ts
@@ -15,11 +15,11 @@ export type HassioHostInfo = {
};
export interface HassioHassOSInfo {
- board: string;
- boot: string;
+ board: string | null;
+ boot: string | null;
update_available: boolean;
- version_latest: string;
- version: string;
+ version_latest: string | null;
+ version: string | null;
}
export const fetchHassioHostInfo = async (hass: HomeAssistant) => {
diff --git a/src/data/supervisor/supervisor.ts b/src/data/supervisor/supervisor.ts
new file mode 100644
index 0000000000..7a5e6c2705
--- /dev/null
+++ b/src/data/supervisor/supervisor.ts
@@ -0,0 +1,18 @@
+import { HassioHassOSInfo, HassioHostInfo } from "../hassio/host";
+import { NetworkInfo } from "../hassio/network";
+import { HassioResolution } from "../hassio/resolution";
+import {
+ HassioHomeAssistantInfo,
+ HassioInfo,
+ HassioSupervisorInfo,
+} from "../hassio/supervisor";
+
+export interface Supervisor {
+ host: HassioHostInfo;
+ supervisor: HassioSupervisorInfo;
+ info: HassioInfo;
+ core: HassioHomeAssistantInfo;
+ network: NetworkInfo;
+ resolution: HassioResolution;
+ os: HassioHassOSInfo;
+}