mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-25 18:26:35 +00:00
Search for boards explicitly in the return value of hardware/info
(#14320)
This commit is contained in:
parent
8b8a85b4b8
commit
245202c125
@ -206,7 +206,9 @@ class HaConfigSystemNavigation extends LitElement {
|
|||||||
const hardwareInfo: HardwareInfo = await this.hass.callWS({
|
const hardwareInfo: HardwareInfo = await this.hass.callWS({
|
||||||
type: "hardware/info",
|
type: "hardware/info",
|
||||||
});
|
});
|
||||||
this._boardName = hardwareInfo?.hardware?.[0]?.name;
|
this._boardName = hardwareInfo?.hardware.find(
|
||||||
|
(hw) => hw.board !== null
|
||||||
|
)?.name;
|
||||||
} else if (isHassioLoaded) {
|
} else if (isHassioLoaded) {
|
||||||
const osData: HassioHassOSInfo = await fetchHassioHassOsInfo(this.hass);
|
const osData: HassioHassOSInfo = await fetchHassioHassOsInfo(this.hass);
|
||||||
if (osData.board) {
|
if (osData.board) {
|
||||||
|
@ -176,9 +176,11 @@ class HaConfigHardware extends SubscribeMixin(LitElement) {
|
|||||||
let imageURL: string | undefined;
|
let imageURL: string | undefined;
|
||||||
let documentationURL: string | undefined;
|
let documentationURL: string | undefined;
|
||||||
|
|
||||||
if (this._hardwareInfo?.hardware.length) {
|
const boardData = this._hardwareInfo?.hardware.find(
|
||||||
const boardData = this._hardwareInfo.hardware[0];
|
(hw) => hw.board !== null
|
||||||
|
);
|
||||||
|
|
||||||
|
if (boardData) {
|
||||||
boardId = boardData.board.hassio_board_id;
|
boardId = boardData.board.hassio_board_id;
|
||||||
boardName = boardData.name;
|
boardName = boardData.name;
|
||||||
documentationURL = boardData.url;
|
documentationURL = boardData.url;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user