@apocaliss92/scrypted-reolink-native 0.1.13 → 0.1.14
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/main.nodejs.js +1 -1
- package/dist/plugin.zip +0 -0
- package/package.json +1 -1
- package/src/common.ts +10 -0
package/dist/plugin.zip
CHANGED
|
Binary file
|
package/package.json
CHANGED
package/src/common.ts
CHANGED
|
@@ -566,6 +566,16 @@ export abstract class CommonCameraMixin extends BaseBaichuanClass implements Vid
|
|
|
566
566
|
onClose: async () => {
|
|
567
567
|
// Reset client state on close
|
|
568
568
|
// The base class already handles cleanup
|
|
569
|
+
// Resubscribe to events after reconnection
|
|
570
|
+
// Use setTimeout to allow the connection to be re-established first
|
|
571
|
+
setTimeout(async () => {
|
|
572
|
+
try {
|
|
573
|
+
await this.subscribeToEvents();
|
|
574
|
+
} catch (e) {
|
|
575
|
+
const logger = this.getBaichuanLogger();
|
|
576
|
+
logger.warn('Failed to resubscribe to events after reconnection', e);
|
|
577
|
+
}
|
|
578
|
+
}, 1000);
|
|
569
579
|
},
|
|
570
580
|
onSimpleEvent: this.onSimpleEvent,
|
|
571
581
|
getEventSubscriptionEnabled: () => this.isEventDispatchEnabled?.() ?? false,
|