Add native hub protocol integrations

This commit is contained in:
2026-05-05 14:57:06 +00:00
parent 2823a1c718
commit 1eebd71e7d
102 changed files with 16316 additions and 330 deletions
+19
View File
@@ -0,0 +1,19 @@
import { expect, tap } from '@git.zone/tstest/tapbundle';
import { createZhaDiscoveryDescriptor } from '../../ts/integrations/zha/index.js';
tap.test('matches known ZHA USB coordinator records', async () => {
const descriptor = createZhaDiscoveryDescriptor();
const matcher = descriptor.getMatchers().find((matcherArg) => matcherArg.id === 'zha-usb-match');
const result = await matcher!.matches({
vid: '10C4',
pid: 'EA60',
manufacturer: 'SONOFF',
description: 'SONOFF Zigbee 3.0 USB Dongle Plus',
path: '/dev/ttyUSB0',
}, {});
expect(result.matched).toBeTrue();
expect(result.candidate?.integrationDomain).toEqual('zha');
expect(result.candidate?.metadata?.radioPath).toEqual('/dev/ttyUSB0');
});
export default tap.start();