From 0a45ff6af87f01576aca02611a938a9dab03d50a Mon Sep 17 00:00:00 2001 From: Jacky Liang Date: Sat, 17 Feb 2024 00:15:00 -0500 Subject: [PATCH] Added new devices and fixed bugs ### UPDATED - `removePersonalIdentifiableInformation` will now include device last update and next update. ### FIXED - `removePersonalIdentifiableInformation` did not properly redact some information belonging to array of strings. ### ADDED - TSSC Lifestyle Module Gateway and Security Panel. --- README.md | 12 ++++++------ package.json | 2 +- src/lib/items.ts | 27 +++++++++++++++++++++------ src/lib/utility.ts | 11 ++++++++++- 4 files changed, 38 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 50326a3..e594289 100644 --- a/README.md +++ b/README.md @@ -227,13 +227,13 @@ Here is an example of the information I see when the plugin detects unknown stat ```json { "communication": { - "broadbandConnectionStatus": "Unavailable", + "broadbandConnectionStatus": "Active", "cellularConnectionStatus": "N/A", "cellularSignalStrength": "N/A", "primaryConnectionType": "Broadband" }, "manufacturer": "ADT Pulse Gateway", - "model": "XYZ", + "model": "PGZNG1", "network": { "broadband": { "ip": "*** REDACTED FOR PRIVACY ***", @@ -251,12 +251,12 @@ Here is an example of the information I see when the plugin detects unknown stat "serialNumber": "*** REDACTED FOR PRIVACY ***", "status": "Online", "update": { - "last": "Yesterday 12:00 PM", - "next": "Today 12:00 PM" + "last": "*** REDACTED FOR PRIVACY ***", + "next": "*** REDACTED FOR PRIVACY ***" }, "versions": { - "firmware": "1.0.0", - "hardware": "1.0.0" + "firmware": "1.0.0-9", + "hardware": "HW=2, BL=1.0.0, PL=1.0.0, SKU=12345" } } ``` diff --git a/package.json b/package.json index cdeb607..596a9a1 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "homebridge-adt-pulse", "displayName": "Homebridge ADT Pulse", - "version": "3.1.5", + "version": "3.1.6", "description": "Homebridge security system platform for ADT Pulse", "main": "./build/index.js", "exports": "./build/index.js", diff --git a/src/lib/items.ts b/src/lib/items.ts index db6873b..98a9886 100644 --- a/src/lib/items.ts +++ b/src/lib/items.ts @@ -276,10 +276,20 @@ export const deviceGateways: DeviceGateways = [ cellularSignalStrength: 'N/A', firmwareVersion: '27.0.0-140', hardwareVersion: 'HW=02_CSMAP, BL=NA, PL=27.0.0-140', - manufacturer: '', + manufacturer: null, model: 'Compact SMA Protocol Gateway', primaryConnectionType: 'Cellular', }, + { + broadbandConnectionStatus: 'Active', + cellularConnectionStatus: 'N/A', + cellularSignalStrength: 'N/A', + firmwareVersion: '24.0.0-9', + hardwareVersion: 'HW=0002, BL=UBOOT 2009.08-svn99, PL=5.5.0-5, SKU=TSSC-NA-NONE-01', + manufacturer: 'ADT', + model: 'TSSC Lifestyle Module', + primaryConnectionType: 'Broadband', + }, ]; /** @@ -288,6 +298,16 @@ export const deviceGateways: DeviceGateways = [ * @since 1.0.0 */ export const deviceSecurityPanels: DeviceSecurityPanels = [ + { + emergencyKeys: 'Button: Fire Alarm (Zone 995) Button: Audible Panic Alarm (Zone 999)', + manufacturerProvider: 'ADT', + typeModel: 'TSSC Life Safety Module', + }, + { + emergencyKeys: null, + manufacturerProvider: 'DSC', + typeModel: 'Security Panel - Impassa SCW9057', + }, { emergencyKeys: 'Button: Fire Alarm (Zone 95) Button: Audible Panic Alarm (Zone 99)', manufacturerProvider: 'ADT', @@ -298,11 +318,6 @@ export const deviceSecurityPanels: DeviceSecurityPanels = [ manufacturerProvider: 'ADT', typeModel: 'Security Panel - Safewatch Pro 3000/3000CN', }, - { - emergencyKeys: null, - manufacturerProvider: 'DSC', - typeModel: 'Security Panel - Impassa SCW9057', - }, ]; /** diff --git a/src/lib/utility.ts b/src/lib/utility.ts index d30c6ab..f362a28 100644 --- a/src/lib/utility.ts +++ b/src/lib/utility.ts @@ -1387,9 +1387,13 @@ export function removePersonalIdentifiableInformation(data: RemovePersonalIdenti 'Device LAN IP Address:', 'Device LAN MAC:', 'ip', + 'Last Update:', 'lanIp', + 'last', 'mac', 'masterCode', + 'Next Update:', + 'next', 'Router LAN IP Address:', 'Router WAN IP Address:', 'sat', @@ -1399,6 +1403,7 @@ export function removePersonalIdentifiableInformation(data: RemovePersonalIdenti 'Serial Number:', 'wanIp', ]; + const replacementText = '*** REDACTED FOR PRIVACY ***'; /** * Remove personal identifiable information - Replace value. @@ -1423,10 +1428,14 @@ export function removePersonalIdentifiableInformation(data: RemovePersonalIdenti return replaceValue(item); } + if (redactedKeys.includes(key)) { + return replacementText; + } + return item; }); } else if (redactedKeys.includes(key)) { - modifiedObject[key] = '*** REDACTED FOR PRIVACY ***'; + modifiedObject[key] = replacementText; } else { modifiedObject[key] = value; }