Skip to content

Commit

Permalink
fix: ignoring S1 and new version of L1 pid
Browse files Browse the repository at this point in the history
  • Loading branch information
pkhansen committed Oct 3, 2022
1 parent 28aff78 commit 05e4f23
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 18 deletions.
28 changes: 14 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
"url": "https://github.com/Huddly/device-api-usb/issues"
},
"dependencies": {
"@huddly/sdk-interfaces": "^0.1.1",
"@huddly/sdk-interfaces": "^0.2.1",
"@types/node": "^15.12.2",
"await-sleep": "0.0.1",
"chalk": "^4.1.2",
Expand Down
6 changes: 5 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ export default class HuddlyDeviceAPIUSB implements IHuddlyDeviceAPI {
}

async getValidatedTransport(device): Promise<ITransport> {
if ([HuddlyHEX.GO_PID, HuddlyHEX.L1_PID, HuddlyHEX.BASE_PID].includes(device.productId)) {
if (
[HuddlyHEX.GO_PID, HuddlyHEX.L1_PID, HuddlyHEX.BASE_PID, HuddlyHEX.S1_PID].includes(
device.productId
)
) {
Logger.warn(
`HLink is not supported for Huddly device with PID ${device.productId}`,
'Device API USB'
Expand Down
12 changes: 10 additions & 2 deletions tests/api.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,11 @@ const mockedDevices = [
},
{
serialNumber: '534654324',
productId: 3e9
productId: 81000011
},
{
serialNumber: '534654324',
productId: 81000014
},
];

Expand Down Expand Up @@ -69,11 +73,15 @@ describe('HuddlyDeviceApiUSB', () => {
expect(transport).to.be.undefined;
});
});
describe('for huddly l1', () => {
describe('for ip cameras', () => {
it('should not support huddly l1 devices', async () => {
const transport = await deviceApi.getValidatedTransport(mockedDevices[3]);
expect(transport).to.be.undefined;
});
it('should not support huddly s1 devices', async () => {
const transport = await deviceApi.getValidatedTransport(mockedDevices[3]);
expect(transport).to.be.undefined;
});
});


Expand Down

0 comments on commit 05e4f23

Please sign in to comment.