Display Z-Wave home ID as hexadecimal (#29187)

This commit is contained in:
AlCalzone 2026-01-26 12:58:09 +01:00 committed by GitHub
parent 63284b328c
commit 9ba34869be
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 1 deletions

View File

@ -0,0 +1,9 @@
/**
* Formats a Z-Wave home ID as an uppercase hexadecimal string with 0x prefix.
* Z-Wave home IDs are 32-bit values (4 bytes).
*
* @param homeId - The home ID as a number
* @returns Formatted hex string (e.g., "0xD34DB33F")
*/
export const formatHomeIdAsHex = (homeId: number): string =>
"0x" + homeId.toString(16).toUpperCase().padStart(8, "0");

View File

@ -56,6 +56,7 @@ import { showZWaveJSAddNodeDialog } from "./add-node/show-dialog-zwave_js-add-no
import { showZWaveJSRebuildNetworkRoutesDialog } from "./show-dialog-zwave_js-rebuild-network-routes";
import { showZWaveJSRemoveNodeDialog } from "./show-dialog-zwave_js-remove-node";
import { configTabs } from "./zwave_js-config-router";
import { formatHomeIdAsHex } from "./functions";
@customElement("zwave_js-config-dashboard")
class ZWaveJSConfigDashboard extends SubscribeMixin(LitElement) {
@ -271,7 +272,11 @@ class ZWaveJSConfigDashboard extends SubscribeMixin(LitElement) {
"ui.panel.config.zwave_js.dashboard.home_id"
)}:
</span>
<span>${this._network.controller.home_id}</span>
<span
>${formatHomeIdAsHex(
this._network.controller.home_id
)}</span
>
</div>
<div class="row">
<span>