From 30c55c15446a8d180be8341abf5f0fd717b76c32 Mon Sep 17 00:00:00 2001 From: Ben <43026681+bwp91@users.noreply.github.com> Date: Sat, 30 Sep 2023 20:21:27 +0100 Subject: [PATCH] update systeminformation (#1571) --- package-lock.json | 8 ++++---- package.json | 2 +- src/bin/hb-service.ts | 4 ++++ src/modules/server/server.service.ts | 6 +++++- src/modules/status/status.service.ts | 5 +++++ 5 files changed, 19 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index d20766164..57eba3f0f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -50,7 +50,7 @@ "reflect-metadata": "0.1.13", "rxjs": "7.8.1", "semver": "7.5.4", - "systeminformation": "5.16.9", + "systeminformation": "5.21.9", "tail": "2.2.6", "tar": "6.2.0", "tcp-port-used": "1.0.2", @@ -11065,9 +11065,9 @@ "integrity": "sha512-mVZc9QVQ6pTCV5crli3+Ng+DoMPwdtMHK8QLk2oX8Mtamp4D/hV+uYdC3lV0JZrDgpNEcjs0RrWTqMwwosuLPQ==" }, "node_modules/systeminformation": { - "version": "5.16.9", - "resolved": "https://registry.npmjs.org/systeminformation/-/systeminformation-5.16.9.tgz", - "integrity": "sha512-QTlv3GGSromPeLVW3pzM6uxU8RbkacW9e0+ZX23GAXaX+XE0UToSygAxCJDHSty6RB9lAFHCHg+FfiXFChi/+w==", + "version": "5.21.9", + "resolved": "https://registry.npmjs.org/systeminformation/-/systeminformation-5.21.9.tgz", + "integrity": "sha512-7pI4mu9P/2MGDV0T49B52E7IULBGj+kRVk6JSYUj5qfAk7N7C7aNX15fXziqrbgZntc6/jjYzWeb/x41jhg/eA==", "os": [ "darwin", "linux", diff --git a/package.json b/package.json index 04e37494c..e2c9219d4 100644 --- a/package.json +++ b/package.json @@ -83,7 +83,7 @@ "reflect-metadata": "0.1.13", "rxjs": "7.8.1", "semver": "7.5.4", - "systeminformation": "5.16.9", + "systeminformation": "5.21.9", "tail": "2.2.6", "tar": "6.2.0", "tcp-port-used": "1.0.2", diff --git a/src/bin/hb-service.ts b/src/bin/hb-service.ts index 9ce31b8a3..ec9cc7e93 100644 --- a/src/bin/hb-service.ts +++ b/src/bin/hb-service.ts @@ -653,6 +653,10 @@ export class HomebridgeServiceHelper { */ public async printPostInstallInstructions() { const defaultAdapter = await si.networkInterfaceDefault(); + // These ts-ignore should be able to be removed in the next major release of 'systeminformation' (v6) + // See https://github.com/sebhildebrandt/systeminformation/issues/775#issuecomment-1741836906 + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore const defaultInterface = (await si.networkInterfaces()).find(x => x.iface === defaultAdapter); console.log('\nManage Homebridge by going to one of the following in your browser:\n'); diff --git a/src/modules/server/server.service.ts b/src/modules/server/server.service.ts index b42cb42e3..3e7bd0eaf 100644 --- a/src/modules/server/server.service.ts +++ b/src/modules/server/server.service.ts @@ -109,7 +109,7 @@ export class ServerService { /** * Return a single device pairing - * @param deviceId + * @param deviceId */ public async getDevicePairingById(deviceId: string) { const persistPath = path.join(this.configService.storagePath, 'persist'); @@ -343,6 +343,10 @@ export class ServerService { public async getSystemNetworkInterfaces(): Promise { const fromCache: si.Systeminformation.NetworkInterfacesData[] = this.serverServiceCache.get('network-interfaces'); + // These ts-ignore should be able to be removed in the next major release of 'systeminformation' (v6) + // See https://github.com/sebhildebrandt/systeminformation/issues/775#issuecomment-1741836906 + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore const networkInterfaces = fromCache || (await si.networkInterfaces()).filter((adapter) => { return !adapter.internal && (adapter.ip4 || (adapter.ip6)); diff --git a/src/modules/status/status.service.ts b/src/modules/status/status.service.ts index 958da48e2..3eb45f021 100644 --- a/src/modules/status/status.service.ts +++ b/src/modules/status/status.service.ts @@ -359,6 +359,11 @@ export class StatusService { } const defaultInterfaceName = await si.networkInterfaceDefault(); + + // These ts-ignore should be able to be removed in the next major release of 'systeminformation' (v6) + // See https://github.com/sebhildebrandt/systeminformation/issues/775#issuecomment-1741836906 + // eslint-disable-next-line @typescript-eslint/ban-ts-comment + // @ts-ignore const defaultInterface = defaultInterfaceName ? (await si.networkInterfaces()).find(x => x.iface === defaultInterfaceName) : undefined; if (defaultInterface) {