diff --git a/src/data/hardware.ts b/src/data/hardware.ts new file mode 100644 index 0000000000..54ea838675 --- /dev/null +++ b/src/data/hardware.ts @@ -0,0 +1,22 @@ +// Keep in sync with https://github.com/home-assistant/analytics.home-assistant.io/blob/dev/site/src/analytics-os-boards.ts#L6-L24 +export const BOARD_NAMES: Record = { + "odroid-n2": "Home Assistant Blue / ODROID-N2", + "odroid-xu4": "ODROID-XU4", + "odroid-c2": "ODROID-C2", + "odroid-c4": "ODROID-C4", + rpi: "Raspberry Pi", + rpi0: "Raspberry Pi Zero", + "rpi0-w": "Raspberry Pi Zero W", + rpi2: "Raspberry Pi 2", + rpi3: "Raspberry Pi 3 (32-bit)", + "rpi3-64": "Raspberry Pi 3", + rpi4: "Raspberry Pi 4 (32-bit)", + "rpi4-64": "Raspberry Pi 4", + tinker: "ASUS Tinker Board", + "khadas-vim3": "Khadas VIM3", + "generic-aarch64": "Generic AArch64", + ova: "Virtual Machine", + "generic-x86-64": "Generic x86-64", + "intel-nuc": "Intel NUC", + yellow: "Home Assistant Yellow", +}; diff --git a/src/panels/config/hardware/ha-config-hardware.ts b/src/panels/config/hardware/ha-config-hardware.ts index 833f40b9ee..3430fd1ca3 100644 --- a/src/panels/config/hardware/ha-config-hardware.ts +++ b/src/panels/config/hardware/ha-config-hardware.ts @@ -8,6 +8,7 @@ import "../../../components/ha-alert"; import "../../../components/ha-button-menu"; import "../../../components/ha-card"; import "../../../components/ha-settings-row"; +import { BOARD_NAMES } from "../../../data/hardware"; import { extractApiErrorMessage, ignoreSupervisorError, @@ -56,6 +57,18 @@ class HaConfigHardware extends LitElement { .narrow=${this.narrow} .header=${this.hass.localize("ui.panel.config.hardware.caption")} > + + + ${this.hass.localize( + "ui.panel.config.hardware.available_hardware.title" + )} + ${this._error ? html`
- - ${this.hass.localize( - "ui.panel.config.hardware.board" - )} -
- ${this._OSData.board} -
-
+ ${this._OSData?.board + ? html` + + ${BOARD_NAMES[this._OSData.board] || + this.hass.localize( + "ui.panel.config.hardware.board" + )} +
+ ${this._OSData.board} +
+
+ ` + : ""}
-
- ${this._hostData.features.includes("reboot") - ? html` - - ${this.hass.localize( - "ui.panel.config.hardware.reboot_host" - )} - - ` - : ""} - ${this._hostData.features.includes("shutdown") - ? html` - - ${this.hass.localize( - "ui.panel.config.hardware.shutdown_host" - )} - - ` - : ""} -
- - - - ${this.hass.localize( - "ui.panel.config.hardware.available_hardware.title" - )} - - + ${this._hostData.features.includes("reboot") + ? html` + + ${this.hass.localize( + "ui.panel.config.hardware.reboot_host" + )} + + ` + : ""} + ${this._hostData.features.includes("shutdown") + ? html` + + ${this.hass.localize( + "ui.panel.config.hardware.shutdown_host" + )} + + ` + : ""}
@@ -241,10 +242,6 @@ class HaConfigHardware extends LitElement { justify-content: space-between; align-items: center; } - .buttons { - display: flex; - align-items: center; - } `, ]; } diff --git a/src/translations/en.json b/src/translations/en.json index c84157181d..64db711526 100755 --- a/src/translations/en.json +++ b/src/translations/en.json @@ -1519,7 +1519,7 @@ "caption": "Hardware", "available_hardware": { "failed_to_get": "Failed to get available hardware", - "title": "Available hardware", + "title": "All Hardware", "subsystem": "Subsystem", "device_path": "Device path", "id": "ID",