@homebridge-plugins/homebridge-eufy-security 4.6.0-beta.7 → 4.6.0-beta.8

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.
@@ -96,6 +96,7 @@ case <type_number>: return '<image_large>.png';
96
96
  Execute the plan. Key implementation notes:
97
97
 
98
98
  - **Property mapping**: Use the output from `map-properties.mjs` (Phase 1) as the primary guide. When multiple property constants match the same `param_type` (e.g. `DeviceWatermarkProperty` vs `DeviceWatermarkSoloWiredDoorbellProperty`), pick the variant used by the closest existing device. Check the "Used by DeviceTypes" column in the script output.
99
+ - **Companion custom properties**: Some properties have required companions with `custom_*` keys that never appear in raw device data (they're populated at runtime). The script detects these and marks them with `⚠ companion`. Always include them — omitting a companion breaks functionality silently. Key pairs: `DeviceRTSPStream` → `DeviceRTSPStreamUrl`, `DeviceWifiRSSI` → `DeviceWifiSignalLevel`, `DeviceCellularRSSI` → `DeviceCellularSignalLevel`.
99
100
  - **Insert in order**: When adding to enums, switch statements, or `if` chains, maintain numeric ordering by device type number.
100
101
  - **Audio recording property**: Different device families use different audio recording property constants (e.g. `DeviceAudioRecordingProperty`, `DeviceAudioRecordingStarlight4gLTEProperty`). Match the closest existing device.
101
102
  - **No Co-Authored-By**: Do not add co-author lines to commits.
@@ -298,12 +298,39 @@ if (unmatched.length > 0) {
298
298
  }
299
299
  }
300
300
 
301
+ // ── Step 6: Companion custom properties ─────────────────────────────────────
302
+ // Some param_type-based properties require a companion custom (runtime) property
303
+ // that never appears in raw device data. Define those pairings here so the
304
+ // suggested block always includes both.
305
+
306
+ const COMPANION_PROPERTIES = new Map([
307
+ // DeviceRTSPStream (CMD_NAS_SWITCH) → DeviceRTSPStreamUrl (custom_rtspStreamUrl)
308
+ ["PropertyName.DeviceRTSPStream", {
309
+ propertyName: "PropertyName.DeviceRTSPStreamUrl",
310
+ constName: "DeviceRTSPStreamUrlProperty",
311
+ reason: "RTSP URL is set at runtime by the station — must accompany DeviceRTSPStream",
312
+ }],
313
+ // DeviceWifiRSSI → DeviceWifiSignalLevel (custom_wifiSignalLevel)
314
+ ["PropertyName.DeviceWifiRSSI", {
315
+ propertyName: "PropertyName.DeviceWifiSignalLevel",
316
+ constName: "DeviceWifiSignalLevelProperty",
317
+ reason: "WiFi signal level is derived at runtime from RSSI",
318
+ }],
319
+ // DeviceCellularRSSI → DeviceCellularSignalLevel (custom_cellularSignalLevel)
320
+ ["PropertyName.DeviceCellularRSSI", {
321
+ propertyName: "PropertyName.DeviceCellularSignalLevel",
322
+ constName: "DeviceCellularSignalLevelProperty",
323
+ reason: "Cellular signal level is derived at runtime from RSSI",
324
+ }],
325
+ ]);
326
+
301
327
  // Output a suggested PropertyName list for use in DeviceProperties block
302
328
  console.log();
303
329
  console.log("=".repeat(80));
304
330
  console.log("SUGGESTED DeviceProperties block entries:");
305
331
  console.log("=".repeat(80));
306
332
  const seen = new Set();
333
+ const companionsAdded = [];
307
334
  for (const m of matched) {
308
335
  for (let i = 0; i < m.constNames.length; i++) {
309
336
  const pn = m.propertyNames[0]; // Use first PropertyName
@@ -311,6 +338,24 @@ for (const m of matched) {
311
338
  if (pn && !seen.has(pn)) {
312
339
  seen.add(pn);
313
340
  console.log(` [${pn}]: ${cn},`);
341
+
342
+ // Check if this property has a required companion
343
+ const companion = COMPANION_PROPERTIES.get(pn);
344
+ if (companion && !seen.has(companion.propertyName)) {
345
+ seen.add(companion.propertyName);
346
+ console.log(` [${companion.propertyName}]: ${companion.constName}, // ⚠ companion (custom/runtime)`);
347
+ companionsAdded.push(companion);
348
+ }
314
349
  }
315
350
  }
316
351
  }
352
+
353
+ if (companionsAdded.length > 0) {
354
+ console.log();
355
+ console.log("=".repeat(80));
356
+ console.log("⚠ COMPANION PROPERTIES (custom/runtime — not in raw device data):");
357
+ console.log("=".repeat(80));
358
+ for (const c of companionsAdded) {
359
+ console.log(` ${c.constName}: ${c.reason}`);
360
+ }
361
+ }
package/dist/version.js CHANGED
@@ -1,2 +1,2 @@
1
- export const LIB_VERSION = "4.6.0-beta.7";
1
+ export const LIB_VERSION = "4.6.0-beta.8";
2
2
  //# sourceMappingURL=version.js.map
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.6.0-beta.7",
4
+ "version": "4.6.0-beta.8",
5
5
  "description": "Control Eufy Security from homebridge.",
6
6
  "type": "module",
7
7
  "license": "Apache-2.0",