mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-31 13:07:49 +00:00
Start Dongles
This commit is contained in:
parent
38fd6108b4
commit
2c4e769343
@ -61,16 +61,18 @@ class HaConfigHardware extends LitElement {
|
|||||||
let imageURL: string | undefined;
|
let imageURL: string | undefined;
|
||||||
let documentationURL: string | undefined;
|
let documentationURL: string | undefined;
|
||||||
|
|
||||||
if (this._hardwareInfo?.hardware.length) {
|
const hardware = this._hardwareInfo?.hardware.concat();
|
||||||
const boardData = this._hardwareInfo!.hardware[0];
|
|
||||||
|
|
||||||
boardId = boardData.board.hassio_board_id;
|
if (hardware?.length) {
|
||||||
boardName = boardData.name;
|
const boardData = hardware.shift();
|
||||||
documentationURL = boardData.url;
|
|
||||||
|
boardId = boardData!.board.hassio_board_id;
|
||||||
|
boardName = boardData!.name;
|
||||||
|
documentationURL = boardData!.url;
|
||||||
imageURL = hardwareBrandsUrl({
|
imageURL = hardwareBrandsUrl({
|
||||||
category: "boards",
|
category: "boards",
|
||||||
manufacturer: boardData.board.manufacturer,
|
manufacturer: boardData!.board.manufacturer,
|
||||||
model: boardData.board.model,
|
model: boardData!.board.model,
|
||||||
darkOptimized: this.hass.themes?.darkMode,
|
darkOptimized: this.hass.themes?.darkMode,
|
||||||
});
|
});
|
||||||
} else if (this._OSData?.board) {
|
} else if (this._OSData?.board) {
|
||||||
@ -172,6 +174,43 @@ class HaConfigHardware extends LitElement {
|
|||||||
</div>
|
</div>
|
||||||
`
|
`
|
||||||
: ""}
|
: ""}
|
||||||
|
${hardware?.length
|
||||||
|
? html`
|
||||||
|
<ha-card outlined>
|
||||||
|
<div class="connected-hardware-title">Connected Hardware</div>
|
||||||
|
<div class="card-content">
|
||||||
|
<mwc-list>
|
||||||
|
${hardware.map((device) => {
|
||||||
|
const deviceImageURL = hardwareBrandsUrl({
|
||||||
|
category: "boards",
|
||||||
|
manufacturer: device.dongles[0].manufacturer,
|
||||||
|
model: device.dongles[0].model,
|
||||||
|
darkOptimized: this.hass.themes?.darkMode,
|
||||||
|
});
|
||||||
|
|
||||||
|
return html`
|
||||||
|
<mwc-list-item
|
||||||
|
noninteractive
|
||||||
|
graphic=${ifDefined(
|
||||||
|
deviceImageURL ? "medium" : undefined
|
||||||
|
)}
|
||||||
|
twoline
|
||||||
|
>
|
||||||
|
${deviceImageURL
|
||||||
|
? html`<img slot="graphic" src=${deviceImageURL} />`
|
||||||
|
: ""}
|
||||||
|
<span class="primary-text">${device.name}</span>
|
||||||
|
<span class="secondary-text" slot="secondary"
|
||||||
|
>${device.dongles[0].manufacturer}</span
|
||||||
|
>
|
||||||
|
</mwc-list-item>
|
||||||
|
`;
|
||||||
|
})}
|
||||||
|
</mwc-list>
|
||||||
|
</div>
|
||||||
|
</ha-card>
|
||||||
|
`
|
||||||
|
: ""}
|
||||||
</hass-subpage>
|
</hass-subpage>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
@ -276,7 +315,6 @@ class HaConfigHardware extends LitElement {
|
|||||||
ha-card {
|
ha-card {
|
||||||
max-width: 600px;
|
max-width: 600px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
height: 100%;
|
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
display: flex;
|
display: flex;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user