From 554c0b692d393dc18c37e7abb28c5e178b0d14e2 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Fri, 27 Mar 2020 19:55:55 +0100 Subject: [PATCH] Fix supervisor panel (#5348) * Fix supervisor panel * Lint Co-authored-by: Paulus Schoutsen --- hassio/src/addon-view/hassio-addon-info.ts | 6 +++--- hassio/src/dashboard/hassio-update.ts | 14 +++++++------- hassio/src/system/hassio-host-info.ts | 6 ++---- hassio/src/system/hassio-supervisor-info.ts | 4 ++-- src/data/hassio/addon.ts | 2 +- src/data/hassio/host.ts | 2 +- src/data/hassio/supervisor.ts | 2 +- 7 files changed, 17 insertions(+), 19 deletions(-) diff --git a/hassio/src/addon-view/hassio-addon-info.ts b/hassio/src/addon-view/hassio-addon-info.ts index 95503c23fe..cc2bf2e0bf 100644 --- a/hassio/src/addon-view/hassio-addon-info.ts +++ b/hassio/src/addon-view/hassio-addon-info.ts @@ -107,7 +107,7 @@ class HassioAddonInfo extends LitElement { @@ -636,7 +636,7 @@ class HassioAddonInfo extends LitElement { this.addon && !this.addon.detached && this.addon.version && - this.addon.version !== this.addon.last_version + this.addon.version !== this.addon.version_latest ); } diff --git a/hassio/src/dashboard/hassio-update.ts b/hassio/src/dashboard/hassio-update.ts index a48c558b86..d04ed1854a 100644 --- a/hassio/src/dashboard/hassio-update.ts +++ b/hassio/src/dashboard/hassio-update.ts @@ -40,8 +40,8 @@ export class HassioUpdate extends LitElement { ].filter((value) => { return ( !!value && - (value.last_version - ? value.version !== value.last_version + (value.version_latest + ? value.version !== value.version_latest : value.version_latest ? value.version !== value.version_latest : false) @@ -68,26 +68,26 @@ export class HassioUpdate extends LitElement { ${this._renderUpdateCard( "Home Assistant Core", this.hassInfo.version, - this.hassInfo.last_version, + this.hassInfo.version_latest, "hassio/homeassistant/update", `https://${ - this.hassInfo.last_version.includes("b") ? "rc" : "www" + this.hassInfo.version_latest.includes("b") ? "rc" : "www" }.home-assistant.io/latest-release-notes/`, "hassio:home-assistant" )} ${this._renderUpdateCard( "Supervisor", this.supervisorInfo.version, - this.supervisorInfo.last_version, + this.supervisorInfo.version_latest, "hassio/supervisor/update", - `https://github.com//home-assistant/hassio/releases/tag/${this.supervisorInfo.last_version}` + `https://github.com//home-assistant/hassio/releases/tag/${this.supervisorInfo.version_latest}` )} ${this.hassOsInfo ? this._renderUpdateCard( "Operating System", this.hassOsInfo.version, this.hassOsInfo.version_latest, - "hassio/hassos/update", + "hassio/os/update", `https://github.com//home-assistant/hassos/releases/tag/${this.hassOsInfo.version_latest}` ) : ""} diff --git a/hassio/src/system/hassio-host-info.ts b/hassio/src/system/hassio-host-info.ts index bdaaecbcfa..3c50ece8af 100644 --- a/hassio/src/system/hassio-host-info.ts +++ b/hassio/src/system/hassio-host-info.ts @@ -100,7 +100,7 @@ class HassioHostInfo extends LitElement { Import from USB @@ -108,9 +108,7 @@ class HassioHostInfo extends LitElement { : ""} ${this.hostInfo.version !== this.hostInfo.version_latest ? html` - Update ` diff --git a/hassio/src/system/hassio-supervisor-info.ts b/hassio/src/system/hassio-supervisor-info.ts index 09364b4233..75892b731b 100644 --- a/hassio/src/system/hassio-supervisor-info.ts +++ b/hassio/src/system/hassio-supervisor-info.ts @@ -41,7 +41,7 @@ class HassioSupervisorInfo extends LitElement { Latest version - ${this.supervisorInfo.last_version} + ${this.supervisorInfo.version_latest} ${this.supervisorInfo.channel !== "stable" ? html` @@ -63,7 +63,7 @@ class HassioSupervisorInfo extends LitElement { Reload - ${this.supervisorInfo.version !== this.supervisorInfo.last_version + ${this.supervisorInfo.version !== this.supervisorInfo.version_latest ? html` { return hassioApiResultExtractor( await hass.callApi>( "GET", - "hassio/hassos/info" + "hassio/os/info" ) ); }; diff --git a/src/data/hassio/supervisor.ts b/src/data/hassio/supervisor.ts index 166cea837f..bed2c34d0a 100644 --- a/src/data/hassio/supervisor.ts +++ b/src/data/hassio/supervisor.ts @@ -23,7 +23,7 @@ export const fetchHassioHomeAssistantInfo = async (hass: HomeAssistant) => { return hassioApiResultExtractor( await hass.callApi>( "GET", - "hassio/homeassistant/info" + "hassio/core/info" ) ); };