@camstack/addon-provider-amcrest 0.2.68 → 0.2.69
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/addon.js +9 -1
- package/dist/addon.mjs +9 -1
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -33508,7 +33508,15 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
33508
33508
|
if (!Class) throw new Error(`no device class registered for type "${saved.type}"`);
|
|
33509
33509
|
if (saved.parentDeviceId !== null && !restored.has(saved.parentDeviceId)) throw new Error(`parent device ${saved.parentDeviceId} not restored`);
|
|
33510
33510
|
await this.healSavedConfig(saved, savedDevices);
|
|
33511
|
-
|
|
33511
|
+
try {
|
|
33512
|
+
await this.ctx.kernel.devices.create(saved.stableId, Class, {}, saved.parentDeviceId);
|
|
33513
|
+
} catch (err) {
|
|
33514
|
+
if (!(await this.ctx.kernel.devices.getAll()).some((device) => device.stableId === saved.stableId)) throw err;
|
|
33515
|
+
this.ctx.logger.debug("Restore row came to life during its own dial — kept", { tags: {
|
|
33516
|
+
deviceId: saved.id,
|
|
33517
|
+
stableId: saved.stableId
|
|
33518
|
+
} });
|
|
33519
|
+
}
|
|
33512
33520
|
restored.add(saved.id);
|
|
33513
33521
|
};
|
|
33514
33522
|
const topLevel = savedDevices.filter((saved) => saved.parentDeviceId === null);
|
package/dist/addon.mjs
CHANGED
|
@@ -33509,7 +33509,15 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
33509
33509
|
if (!Class) throw new Error(`no device class registered for type "${saved.type}"`);
|
|
33510
33510
|
if (saved.parentDeviceId !== null && !restored.has(saved.parentDeviceId)) throw new Error(`parent device ${saved.parentDeviceId} not restored`);
|
|
33511
33511
|
await this.healSavedConfig(saved, savedDevices);
|
|
33512
|
-
|
|
33512
|
+
try {
|
|
33513
|
+
await this.ctx.kernel.devices.create(saved.stableId, Class, {}, saved.parentDeviceId);
|
|
33514
|
+
} catch (err) {
|
|
33515
|
+
if (!(await this.ctx.kernel.devices.getAll()).some((device) => device.stableId === saved.stableId)) throw err;
|
|
33516
|
+
this.ctx.logger.debug("Restore row came to life during its own dial — kept", { tags: {
|
|
33517
|
+
deviceId: saved.id,
|
|
33518
|
+
stableId: saved.stableId
|
|
33519
|
+
} });
|
|
33520
|
+
}
|
|
33513
33521
|
restored.add(saved.id);
|
|
33514
33522
|
};
|
|
33515
33523
|
const topLevel = savedDevices.filter((saved) => saved.parentDeviceId === null);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-provider-amcrest",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.69",
|
|
4
4
|
"description": "Amcrest/Dahua camera device provider addon for CamStack — Dahua CGI over HTTP(S) with digest auth (snapshot, RTSP catalog, PTZ, image/day-night config)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|