mirror of
https://github.com/home-assistant/frontend.git
synced 2026-02-04 01:10:33 -06:00
Display Z-Wave home ID as hexadecimal (#29187)
This commit is contained in:
parent
63284b328c
commit
9ba34869be
@ -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");
|
||||
@ -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>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user