homebridge-ring-secure-video 1.0.0-beta.1 → 1.0.0-beta.2

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/CHANGELOG.md CHANGED
@@ -1,5 +1,15 @@
1
1
  # homebridge-ring-secure-video
2
2
 
3
+ ## 1.0.0-beta.2 (2026-11-13)
4
+
5
+ - The Homebridge UI shows the plugin as "Ring Secure Video" (was "Homebridge Ring Secure Video"),
6
+ matching its platform name in the settings and the log.
7
+ - ring-client-api now runs on the whole of `@eneris/push-receiver` 4.3.1, not only its decrypt
8
+ function, so it also gets 4.3.1's other push client fixes. The plugin puts its 4.3.1 in place of
9
+ ring-client-api's pinned 4.3.0 before ring-client-api loads; if that copy was already loaded, it
10
+ falls back to swapping in 4.3.1's decrypt function as before. The log says at start which one
11
+ was applied, and warns if neither could be.
12
+
3
13
  ## 1.0.0-beta.1 (2026-11-13)
4
14
 
5
15
  First release as `homebridge-ring-secure-video`, continuing trinityhades/homebridge-ring-hksv
package/README.md CHANGED
@@ -164,9 +164,9 @@ For support and debugging:
164
164
  - Upstream Ring wiki (token/auth/camera references): <https://github.com/dgreif/ring/wiki>
165
165
 
166
166
  If motion and doorbell events arrive late (the log shows "Detected Motion from Ring event history
167
- fallback" rather than right away), Ring's instant notifications aren't reaching the plugin. With debug
168
- logging on, the log says at start whether the push decryption fix for `@eneris/push-receiver` was
169
- applied. See also the upstream [notification troubleshooting](https://github.com/dgreif/ring/wiki/Notification-Troubleshooting).
167
+ fallback" rather than right away), Ring's instant notifications aren't reaching the plugin. At start the
168
+ log says which `@eneris/push-receiver` the Ring push client uses ("Ring push notifications: ..."), or
169
+ warns "Could not fix Ring push notifications" if the plugin couldn't give it the fixed 4.3.1. See also the upstream [notification troubleshooting](https://github.com/dgreif/ring/wiki/Notification-Troubleshooting).
170
170
 
171
171
  Use the "Force Ring Push Credential Refresh" and "Force Ring API Session Refresh" settings only as a
172
172
  last resort, once. Each refresh adds a registration with Ring, and repeated ones can make Ring stop
package/lib/index.js CHANGED
@@ -1,5 +1,10 @@
1
- import { platformName, RingPlatform } from "./ring-platform.js";
2
1
  import { setHap } from "./hap.js";
2
+ // The push-receiver fix has to run before Node even reads ring-client-api's imports: Node reads a
3
+ // module's whole static import graph before running any of it, and from then on ring-client-api is
4
+ // tied to its own @eneris/push-receiver 4.3.0. So it is loaded first, and everything that leads to
5
+ // ring-client-api (ring-platform.ts) only after it (see push-receiver-fix.ts).
6
+ await import("./push-receiver-fix.js");
7
+ const { platformName, RingPlatform } = await import("./ring-platform.js");
3
8
  export default function (api) {
4
9
  setHap(api.hap);
5
10
  api.registerPlatform(platformName, RingPlatform);
@@ -1,6 +1,8 @@
1
- import { createRequire } from 'node:module';
1
+ import Module, { createRequire } from 'node:module';
2
2
  const decryptPath = '@eneris/push-receiver/dist/utils/decrypt.js';
3
- export function applyPushReceiverDecryptFix() {
3
+ const loggerPath = '@eneris/push-receiver/dist/utils/logger.js';
4
+ const moduleCache = Module._cache;
5
+ export function applyPushReceiverFix() {
4
6
  try {
5
7
  const ownRequire = createRequire(import.meta.url), ringRequire = createRequire(ownRequire.resolve('ring-client-api')), loadedVersion = ringRequire('@eneris/push-receiver/package.json').version;
6
8
  if (loadedVersion !== '4.3.0') {
@@ -9,26 +11,39 @@ export function applyPushReceiverDecryptFix() {
9
11
  detail: `ring-client-api uses @eneris/push-receiver ${loadedVersion}`,
10
12
  };
11
13
  }
12
- const fixedVersion = ownRequire('@eneris/push-receiver/package.json').version;
13
- if (fixedVersion === loadedVersion) {
14
+ const fixedVersion = ownRequire('@eneris/push-receiver/package.json').version, target = ringRequire.resolve('@eneris/push-receiver'), fixed = ownRequire.resolve('@eneris/push-receiver');
15
+ if (fixedVersion === loadedVersion || target === fixed) {
14
16
  return {
15
17
  result: 'failed',
16
18
  detail: `only @eneris/push-receiver ${loadedVersion} is installed; reinstall the plugin`,
17
19
  };
18
20
  }
19
- const loaded = ringRequire(decryptPath), fixed = ownRequire(decryptPath);
20
- if (typeof loaded.default !== 'function' || typeof fixed.default !== 'function') {
21
+ const targetLogger = ringRequire.resolve(loggerPath);
22
+ if (!moduleCache[target] && !moduleCache[targetLogger]) {
23
+ ownRequire(fixed);
24
+ ownRequire(loggerPath);
25
+ moduleCache[target] = moduleCache[fixed];
26
+ moduleCache[targetLogger] = moduleCache[ownRequire.resolve(loggerPath)];
27
+ return {
28
+ result: 'replaced',
29
+ detail: `ring-client-api loads @eneris/push-receiver ${fixedVersion} instead of ${loadedVersion}`,
30
+ };
31
+ }
32
+ // ring-client-api's copy is already loaded: swap in the fixed decrypt function. The push
33
+ // client looks it up on every message, so this also covers a client already running.
34
+ const loaded = ringRequire(decryptPath), fixedDecrypt = ownRequire(decryptPath);
35
+ if (typeof loaded.default !== 'function' || typeof fixedDecrypt.default !== 'function') {
21
36
  return { result: 'failed', detail: 'unexpected @eneris/push-receiver layout' };
22
37
  }
23
- // push-receiver's client looks this function up on every message, so replacing the
24
- // export also covers a client that is already running.
25
- loaded.default = fixed.default;
38
+ loaded.default = fixedDecrypt.default;
26
39
  return {
27
- result: 'applied',
28
- detail: `ring-client-api's @eneris/push-receiver ${loadedVersion} now decrypts with ${fixedVersion}`,
40
+ result: 'decrypt-patched',
41
+ detail: `ring-client-api's @eneris/push-receiver ${loadedVersion} was already loaded; it now decrypts with ${fixedVersion}`,
29
42
  };
30
43
  }
31
44
  catch (e) {
32
45
  return { result: 'failed', detail: e.message };
33
46
  }
34
47
  }
48
+ // Runs when this module is first imported, before ring-client-api is loaded.
49
+ export const pushReceiverFix = applyPushReceiverFix();
@@ -1,3 +1,6 @@
1
+ // Already applied by index.ts before this module (and so ring-client-api) is loaded; read here
2
+ // for the log line.
3
+ import { pushReceiverFix } from "./push-receiver-fix.js";
1
4
  import { RingApi, RingCamera, RingChime, RingDevice, RingDeviceCategory, RingDeviceType, RingIntercom, } from 'ring-client-api';
2
5
  import { hap } from "./hap.js";
3
6
  import { SecurityPanel } from "./security-panel.js";
@@ -29,7 +32,6 @@ import { Intercom } from "./intercom.js";
29
32
  import { Valve } from "./valve.js";
30
33
  import { normalizeMediaConfig } from "./media-config.js";
31
34
  import { configureHksvResourceGovernor } from "./hksv-work-queue.js";
32
- import { applyPushReceiverDecryptFix } from "./push-receiver-fix.js";
33
35
  import { getMotionNotificationSensorUuid, setUpMotionNotificationSensor, } from "./motion-notification-sensor.js";
34
36
  const ignoreHiddenDeviceTypes = [
35
37
  RingDeviceType.RingNetAdapter,
@@ -172,12 +174,11 @@ export class RingPlatform {
172
174
  },
173
175
  });
174
176
  }
175
- const pushFix = applyPushReceiverDecryptFix();
176
- if (pushFix.result === 'failed') {
177
- this.log.warn(`Could not fix Ring push decryption (${pushFix.detail}); instant motion and doorbell events may not arrive`);
177
+ if (pushReceiverFix.result === 'failed') {
178
+ this.log.warn(`Could not fix Ring push notifications (${pushReceiverFix.detail}); instant motion and doorbell events may not arrive`);
178
179
  }
179
180
  else {
180
- this.log.debug(`Ring push decryption: ${pushFix.detail}`);
181
+ this.log.info(`Ring push notifications: ${pushReceiverFix.detail}`);
181
182
  }
182
183
  config.cameraStatusPollingSeconds = config.cameraStatusPollingSeconds ?? 20;
183
184
  config.locationModePollingSeconds = config.locationModePollingSeconds ?? 20;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "homebridge-ring-secure-video",
3
- "displayName": "Homebridge Ring Secure Video",
4
- "version": "1.0.0-beta.1",
3
+ "displayName": "Ring Secure Video",
4
+ "version": "1.0.0-beta.2",
5
5
  "description": "Homebridge plugin for Ring devices with HomeKit Secure Video recording, based on homebridge-ring and homebridge-ring-hksv",
6
6
  "type": "module",
7
7
  "main": "./lib/index.js",