Skip to content

Commit

Permalink
fix: Proper extended PAN ID from getNetworkParameters (#25174)
Browse files Browse the repository at this point in the history
Co-authored-by: Koen Kanters <koenkanters94@gmail.com>
  • Loading branch information
Nerivec and Koenkk committed Dec 13, 2024
1 parent 0a20e4a commit 2b08c68
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/types/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ export interface Zigbee2MQTTAPI {
};
network: {
pan_id: number;
extended_pan_id: number;
/** `0x${string}` 8-len */
extended_pan_id: string;
channel: number;
};
log_level: 'debug' | 'info' | 'warning' | 'error';
Expand Down
2 changes: 1 addition & 1 deletion test/extensions/bridge.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ describe('Extension: Bridge', () => {
config_schema: settings.schemaJson,
coordinator: {ieee_address: '0x00124b00120144ae', meta: {revision: 20190425, version: 1}, type: 'z-Stack'},
log_level: 'info',
network: {channel: 15, extended_pan_id: 0x001122, pan_id: 5674},
network: {channel: 15, extended_pan_id: '0x64c5fd698daf0c00', pan_id: 5674},
permit_join: false,
permit_join_end: undefined,
restart_required: false,
Expand Down
4 changes: 3 additions & 1 deletion test/mocks/zigbeeHerdsman.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1098,7 +1098,9 @@ export const mockController = {
backup: jest.fn(),
coordinatorCheck: jest.fn(),
getCoordinatorVersion: jest.fn((): Promise<CoordinatorVersion> => Promise.resolve({type: 'z-Stack', meta: {version: 1, revision: 20190425}})),
getNetworkParameters: jest.fn((): Promise<NetworkParameters> => Promise.resolve({panID: 0x162a, extendedPanID: 0x001122, channel: 15})),
getNetworkParameters: jest.fn(
(): Promise<NetworkParameters> => Promise.resolve({panID: 0x162a, extendedPanID: '0x64c5fd698daf0c00', channel: 15}),
),
getDevices: jest.fn((): Device[] => []),
getDevicesIterator: jest.fn(function* (predicate?: (value: Device) => boolean): Generator<Device> {
for (const key in devices) {
Expand Down

0 comments on commit 2b08c68

Please sign in to comment.