Skip to content

Commit

Permalink
Added new devices and fixed bugs
Browse files Browse the repository at this point in the history
### 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.
  • Loading branch information
mrjackyliang committed Feb 17, 2024
1 parent cbfdfda commit 0a45ff6
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 14 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 ***",
Expand All @@ -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"
}
}
```
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
27 changes: 21 additions & 6 deletions src/lib/items.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
];

/**
Expand All @@ -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',
Expand All @@ -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',
},
];

/**
Expand Down
11 changes: 10 additions & 1 deletion src/lib/utility.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand All @@ -1399,6 +1403,7 @@ export function removePersonalIdentifiableInformation(data: RemovePersonalIdenti
'Serial Number:',
'wanIp',
];
const replacementText = '*** REDACTED FOR PRIVACY ***';

/**
* Remove personal identifiable information - Replace value.
Expand All @@ -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;
}
Expand Down

0 comments on commit 0a45ff6

Please sign in to comment.