Skip to content

Commit af7fdd6

Browse files
authored
fix: add OUI display (#449)
* fix: add OUI display * fix: add missing Telink OUIs
1 parent 8b8301c commit af7fdd6

3 files changed

Lines changed: 1153 additions & 2 deletions

File tree

src/components/device-page/tabs/DeviceInfo.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { useTranslation } from "react-i18next";
66
import { Link } from "react-router";
77
import { useShallow } from "zustand/react/shallow";
88
import { InterviewState, SUPPORT_NEW_DEVICES_DOCS_URL, Z2M_NEW_GITHUB_ISSUE_URL } from "../../../consts.js";
9+
import { OUI } from "../../../oui.js";
910
import { API_URLS, MULTI_INSTANCE, useAppStore } from "../../../store.js";
1011
import type { Device } from "../../../types.js";
1112
import { toHex } from "../../../utils.js";
@@ -140,6 +141,7 @@ export default function DeviceInfo({ sourceIdx, device }: DeviceInfoProps) {
140141

141142
const canOta = useMemo(() => hasOtaCluster(device), [device]);
142143
const otaInstalledVersion = useMemo(() => formatOtaFileVersion(deviceState.update?.installed_version), [deviceState.update?.installed_version]);
144+
const oui = useMemo(() => OUI.get(device.ieee_address.slice(2, 8)) ?? "?", [device.ieee_address]);
143145

144146
const setDeviceDescription = useCallback(
145147
async (id: string, description: string): Promise<void> => {
@@ -279,7 +281,9 @@ export default function DeviceInfo({ sourceIdx, device }: DeviceInfoProps) {
279281
<div className="stat-value text-xl tooltip tooltip-bottom" data-tip={t(($) => $.ieee_address)}>
280282
{device.ieee_address}
281283
</div>
282-
<div className="stat-desc text-base-content/0">-</div>
284+
<div className="stat-desc tooltip tooltip-top" data-tip="Organizationally Unique Identifier / IEEE Vendor Prefix">
285+
OUI: {oui}
286+
</div>
283287
</div>
284288
<div className="stat px-3">
285289
<div className="stat-title">{t(($) => $.network_address)}</div>

0 commit comments

Comments
 (0)