Haos update button (#7419)

This commit is contained in:
Joakim Sørensen 2020-10-21 17:30:41 +02:00 committed by GitHub
parent 30f34eee22
commit 682fa0d3eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 19 additions and 8 deletions

View File

@ -29,7 +29,7 @@ class HassioPanelRouter extends HassRouterPage {
@property({ attribute: false }) public hassioInfo!: HassioInfo;
@property({ attribute: false }) public hostInfo: HassioHostInfo;
@property({ attribute: false }) public hostInfo?: HassioHostInfo;
@property({ attribute: false }) public hassInfo?: HassioHomeAssistantInfo;

View File

@ -68,7 +68,7 @@ class HassioRouter extends HassRouterPage {
@internalProperty() private _supervisorInfo?: HassioSupervisorInfo;
@internalProperty() private _hostInfo: HassioHostInfo;
@internalProperty() private _hostInfo?: HassioHostInfo;
@internalProperty() private _hassioInfo?: HassioInfo;

View File

@ -109,7 +109,7 @@ class HassioHostInfo extends LitElement {
${this.hostInfo.operating_system}
</span>
${this.hostInfo.features.includes("hassos") &&
this.hostInfo.update_available
this.hassOsInfo.update_available
? html`
<ha-progress-button
title="Update the host OS"

View File

@ -7,6 +7,7 @@ import {
property,
TemplateResult,
} from "lit-element";
import { fireEvent } from "../../../src/common/dom/fire_event";
import "../../../src/components/buttons/ha-progress-button";
import "../../../src/components/ha-card";
import "../../../src/components/ha-settings-row";
@ -206,7 +207,7 @@ class HassioSupervisorInfo extends LitElement {
};
await setSupervisorOption(this.hass, data);
await reloadSupervisor(this.hass);
this.supervisorInfo = await fetchHassioSupervisorInfo(this.hass);
fireEvent(this, "hass-api-called", { success: true, response: null });
} catch (err) {
showAlertDialog(this, {
title: "Failed to set supervisor option",

View File

@ -1,13 +1,23 @@
import { HomeAssistant } from "../../types";
import { hassioApiResultExtractor, HassioResponse } from "./common";
export type HassioHostInfo = any;
export type HassioHostInfo = {
chassis: string;
cpe: string;
deployment: string;
disk_free: number;
disk_total: number;
disk_used: number;
features: string[];
hostname: string;
kernel: string;
operating_system: string;
};
export interface HassioHassOSInfo {
board: "ova" | "rpi";
board: string;
boot: string;
update_available: boolean;
version_cli_latest: string;
version_cli: string;
version_latest: string;
version: string;
}