@homebridge-plugins/homebridge-eufy-security 4.4.5-beta.2 → 4.4.5-beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const LIB_VERSION = "4.4.5-beta.
|
|
1
|
+
export const LIB_VERSION = "4.4.5-beta.4";
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
|
Binary file
|
|
@@ -66,6 +66,7 @@ const DeviceImages = {
|
|
|
66
66
|
case 131: case 132: case 133:
|
|
67
67
|
return 'garage_camera_t8452_large.png';
|
|
68
68
|
case 110: return '4g_lte_starlight_large.jpg';
|
|
69
|
+
case 111: return '4g_lte_cam_s330_large.png';
|
|
69
70
|
case 126: return 'sensor_large.png';
|
|
70
71
|
case 140: return 'smartsafe_s10_t7400_large.png';
|
|
71
72
|
case 141: return 'smartsafe_s12_t7401_large.png';
|
|
@@ -202,7 +202,7 @@ const DiagnosticsView = {
|
|
|
202
202
|
try {
|
|
203
203
|
const result = await Api.downloadDiagnostics();
|
|
204
204
|
const rawBuffer = result.buffer || result;
|
|
205
|
-
const filename = result.filename || 'eufy-security-diagnostics.
|
|
205
|
+
const filename = result.filename || 'eufy-security-diagnostics.tar.gz';
|
|
206
206
|
const bytes = new Uint8Array(rawBuffer.data || rawBuffer);
|
|
207
207
|
let binary = '';
|
|
208
208
|
for (let i = 0; i < bytes.length; i++) {
|
|
@@ -210,7 +210,7 @@ const DiagnosticsView = {
|
|
|
210
210
|
}
|
|
211
211
|
const base64 = btoa(binary);
|
|
212
212
|
const a = document.createElement('a');
|
|
213
|
-
a.href = 'data:application/
|
|
213
|
+
a.href = 'data:application/gzip;base64,' + base64;
|
|
214
214
|
a.download = filename;
|
|
215
215
|
document.body.appendChild(a);
|
|
216
216
|
a.click();
|
package/homebridge-ui/server.js
CHANGED
|
@@ -2,7 +2,7 @@ import { EufySecurity, libVersion, Device, PropertyName, CommandName, DeviceType
|
|
|
2
2
|
import * as fs from 'fs';
|
|
3
3
|
import { Logger as TsLogger } from 'tslog';
|
|
4
4
|
import { createStream } from 'rotating-file-stream';
|
|
5
|
-
import {
|
|
5
|
+
import { create as tarCreate } from 'tar';
|
|
6
6
|
import { HomebridgePluginUiServer } from '@homebridge/plugin-ui-utils';
|
|
7
7
|
import path from 'path';
|
|
8
8
|
import { fileURLToPath } from 'url';
|
|
@@ -22,7 +22,7 @@ class UiServer extends HomebridgePluginUiServer {
|
|
|
22
22
|
tsLog;
|
|
23
23
|
storagePath;
|
|
24
24
|
storedAccessories_file;
|
|
25
|
-
|
|
25
|
+
diagnosticsArchivePath;
|
|
26
26
|
|
|
27
27
|
adminAccountUsed = false;
|
|
28
28
|
|
|
@@ -65,7 +65,7 @@ class UiServer extends HomebridgePluginUiServer {
|
|
|
65
65
|
this.storagePath = this.homebridgeStoragePath + '/eufysecurity';
|
|
66
66
|
this.storedAccessories_file = this.storagePath + '/accessories.json';
|
|
67
67
|
this.unsupported_file = this.storagePath + '/unsupported.json';
|
|
68
|
-
this.
|
|
68
|
+
this.diagnosticsArchivePath = null;
|
|
69
69
|
this.config.persistentDir = this.storagePath;
|
|
70
70
|
|
|
71
71
|
this.initLogger();
|
|
@@ -1178,45 +1178,37 @@ class UiServer extends HomebridgePluginUiServer {
|
|
|
1178
1178
|
this.pushEvent('diagnosticsProgress', { progress: 10, status: 'Collecting log files' });
|
|
1179
1179
|
const finalLogFiles = await this.getLogFiles();
|
|
1180
1180
|
|
|
1181
|
-
this.pushEvent('diagnosticsProgress', { progress: 30, status: '
|
|
1182
|
-
const
|
|
1183
|
-
let numberOfFiles = 0;
|
|
1184
|
-
finalLogFiles.forEach(logFile => {
|
|
1185
|
-
const filePath = path.join(this.storagePath, logFile);
|
|
1186
|
-
zip.addFile(filePath);
|
|
1187
|
-
numberOfFiles++;
|
|
1188
|
-
});
|
|
1181
|
+
this.pushEvent('diagnosticsProgress', { progress: 30, status: 'Collecting diagnostic files' });
|
|
1182
|
+
const filesToArchive = [...finalLogFiles];
|
|
1189
1183
|
|
|
1190
1184
|
// Include accessories.json for diagnostics
|
|
1191
1185
|
if (fs.existsSync(this.storedAccessories_file)) {
|
|
1192
|
-
|
|
1193
|
-
numberOfFiles++;
|
|
1186
|
+
filesToArchive.push(path.basename(this.storedAccessories_file));
|
|
1194
1187
|
}
|
|
1195
1188
|
|
|
1196
1189
|
// Include unsupported.json for diagnostics
|
|
1197
1190
|
if (fs.existsSync(this.unsupported_file)) {
|
|
1198
|
-
|
|
1199
|
-
numberOfFiles++;
|
|
1191
|
+
filesToArchive.push(path.basename(this.unsupported_file));
|
|
1200
1192
|
}
|
|
1201
1193
|
|
|
1202
1194
|
this.pushEvent('diagnosticsProgress', { progress: 40, status: 'Checking archive content' });
|
|
1203
|
-
if (
|
|
1195
|
+
if (filesToArchive.length === 0) {
|
|
1204
1196
|
throw new Error('No diagnostic files were found');
|
|
1205
1197
|
}
|
|
1206
1198
|
|
|
1207
1199
|
try {
|
|
1208
1200
|
const now = new Date();
|
|
1209
1201
|
const timestamp = now.toISOString().replace(/[:T]/g, '-').replace(/\..+/, '');
|
|
1210
|
-
this.
|
|
1202
|
+
this.diagnosticsArchivePath = path.join(this.storagePath, `diagnostics-${timestamp}.tar.gz`);
|
|
1211
1203
|
|
|
1212
|
-
this.pushEvent('diagnosticsProgress', { progress: 45, status: `Compressing ${
|
|
1213
|
-
await
|
|
1204
|
+
this.pushEvent('diagnosticsProgress', { progress: 45, status: `Compressing ${filesToArchive.length} files` });
|
|
1205
|
+
await tarCreate({ gzip: true, file: this.diagnosticsArchivePath, cwd: this.storagePath }, filesToArchive);
|
|
1214
1206
|
|
|
1215
1207
|
this.pushEvent('diagnosticsProgress', { progress: 80, status: 'Reading content' });
|
|
1216
|
-
const fileBuffer = fs.readFileSync(this.
|
|
1208
|
+
const fileBuffer = fs.readFileSync(this.diagnosticsArchivePath);
|
|
1217
1209
|
|
|
1218
|
-
this.pushEvent('diagnosticsProgress', { progress: 90, status: 'Returning
|
|
1219
|
-
return { buffer: fileBuffer, filename: path.basename(this.
|
|
1210
|
+
this.pushEvent('diagnosticsProgress', { progress: 90, status: 'Returning archive' });
|
|
1211
|
+
return { buffer: fileBuffer, filename: path.basename(this.diagnosticsArchivePath) };
|
|
1220
1212
|
} catch (error) {
|
|
1221
1213
|
this.log.error('Error while generating diagnostics archive: ' + error);
|
|
1222
1214
|
throw error;
|
|
@@ -1227,8 +1219,8 @@ class UiServer extends HomebridgePluginUiServer {
|
|
|
1227
1219
|
|
|
1228
1220
|
removeDiagnosticsArchive() {
|
|
1229
1221
|
try {
|
|
1230
|
-
if (fs.existsSync(this.
|
|
1231
|
-
fs.unlinkSync(this.
|
|
1222
|
+
if (fs.existsSync(this.diagnosticsArchivePath)) {
|
|
1223
|
+
fs.unlinkSync(this.diagnosticsArchivePath);
|
|
1232
1224
|
}
|
|
1233
1225
|
return true;
|
|
1234
1226
|
} catch {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"displayName": "Homebridge Eufy Security",
|
|
3
3
|
"name": "@homebridge-plugins/homebridge-eufy-security",
|
|
4
|
-
"version": "4.4.5-beta.
|
|
4
|
+
"version": "4.4.5-beta.4",
|
|
5
5
|
"description": "Control Eufy Security from homebridge.",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"license": "Apache-2.0",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"tslog": "^4.10.2",
|
|
49
49
|
"rotating-file-stream": "^3.2.9",
|
|
50
50
|
"pick-port": "^2.2.0",
|
|
51
|
-
"
|
|
51
|
+
"tar": "^7.5.9"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
54
|
"typescript": "^5.9.3",
|