diff --git a/src/panels/config/hardware/ha-config-hardware.ts b/src/panels/config/hardware/ha-config-hardware.ts index b4ebbb4afd..7d88ceb171 100644 --- a/src/panels/config/hardware/ha-config-hardware.ts +++ b/src/panels/config/hardware/ha-config-hardware.ts @@ -37,6 +37,7 @@ import { haStyle } from "../../../resources/styles"; import type { HomeAssistant } from "../../../types"; import { hardwareBrandsUrl } from "../../../util/brands-url"; import { showhardwareAvailableDialog } from "./show-dialog-hardware-available"; +import { extractApiErrorMessage } from "../../../data/hassio/common"; const DATASAMPLES = 60; @@ -55,7 +56,7 @@ class HaConfigHardware extends SubscribeMixin(LitElement) { @property({ type: Boolean }) public narrow = false; - @state() private _error?: { code: string; message: string }; + @state() private _error?: string; @state() private _OSData?: HassioHassOSInfo; @@ -268,11 +269,7 @@ class HaConfigHardware extends SubscribeMixin(LitElement) { ` : ""} ${this._error - ? html` - ${this._error.message || this._error.code} - ` + ? html`${this._error}` : ""}
${boardName || isComponentLoaded(this.hass, "hassio") @@ -466,7 +463,7 @@ class HaConfigHardware extends SubscribeMixin(LitElement) { this._OSData = await fetchHassioHassOsInfo(this.hass); } } catch (err: any) { - this._error = err.message || err; + this._error = extractApiErrorMessage(err); } }