Skip to content

Commit

Permalink
feat: display hexadecimal and decimal values for network addresses (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
Nerivec authored Jul 22, 2024
1 parent ae76814 commit 48568dd
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/components/device-page/info.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,13 @@ export class DeviceInfo extends Component<
{
key: 'network_address',
translationKey: 'network_address',
render: (device: Device) => <dd className="col-12 col-md-7">{toHex(device.network_address)}</dd>,
render: (device: Device) => (
<dd className="col-12 col-md-7">
<abbr title={t('network_address_hex')}>{toHex(device.network_address)}</abbr>
{' / '}
<abbr title={t('network_address_dec')}>{device.network_address}</abbr>
</dd>
),
},
{
key: 'date_code',
Expand Down
10 changes: 9 additions & 1 deletion src/components/zigbee/DevicesTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,15 @@ export function DevicesTable(
}) => (
<>
<div>{device.ieee_address}</div>
<div>({toHex(device.network_address, 4)})</div>
<div>
<abbr
title={`${t('network_address_hex')} (${t('network_address_dec')}: ${
device.network_address
})`}
>
({toHex(device.network_address, 4)})
</abbr>
</div>
</>
),
},
Expand Down
2 changes: 2 additions & 0 deletions src/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -2663,6 +2663,8 @@
"min_rep_interval": "Min rep interval",
"model": "Model",
"network_address": "Network address",
"network_address_hex": "Network address in hexadecimal format",
"network_address_dec": "Network address in decimal format",
"none": "None",
"output_clusters": "Output clusters",
"pic": "Pic",
Expand Down

0 comments on commit 48568dd

Please sign in to comment.