Add native local bus integrations

This commit is contained in:
2026-05-05 18:06:03 +00:00
parent e7441844c9
commit accfa82f36
64 changed files with 10778 additions and 185 deletions
+34
View File
@@ -0,0 +1,34 @@
import { expect, tap } from '@git.zone/tstest/tapbundle';
import { createKnxDiscoveryDescriptor } from '../../ts/integrations/knx/index.js';
tap.test('matches KNXnet/IP gateway descriptors', async () => {
const descriptor = createKnxDiscoveryDescriptor();
const matcher = descriptor.getMatchers().find((matcherArg) => matcherArg.id === 'knx-gateway-descriptor-match');
const result = await matcher!.matches({
ip_addr: '192.168.1.50',
port: 3671,
name: 'MDT SCN-IP000.03',
individual_address: '1.1.1',
supports_tunnelling: true,
supports_tunnelling_tcp: true,
supports_routing: true,
}, {});
expect(result.matched).toBeTrue();
expect(result.candidate?.integrationDomain).toEqual('knx');
expect(result.candidate?.metadata?.connectionType).toEqual('tunneling_tcp');
});
tap.test('matches manual KNX/IP entries', async () => {
const descriptor = createKnxDiscoveryDescriptor();
const matcher = descriptor.getMatchers().find((matcherArg) => matcherArg.id === 'knx-manual-match');
const result = await matcher!.matches({
host: '192.168.1.51',
connectionType: 'tunneling',
individualAddress: '0.0.240',
}, {});
expect(result.matched).toBeTrue();
expect(result.candidate?.host).toEqual('192.168.1.51');
expect(result.candidate?.port).toEqual(3671);
});
export default tap.start();