@camstack/addon-provider-dreame 0.2.65 → 0.2.67
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 +31 -5
- package/dist/addon.mjs +31 -5
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -58058,7 +58058,8 @@ var CameraSwitchAuthoritySchema = discriminatedUnion("kind", [
|
|
|
58058
58058
|
var CameraSwitchUnavailableReasonSchema = _enum([
|
|
58059
58059
|
"no-provider",
|
|
58060
58060
|
"source-unreachable",
|
|
58061
|
-
"not-configured"
|
|
58061
|
+
"not-configured",
|
|
58062
|
+
"device-disabled"
|
|
58062
58063
|
]);
|
|
58063
58064
|
/**
|
|
58064
58065
|
* One switch, resolved for one camera.
|
|
@@ -74098,12 +74099,20 @@ var BatteryStatusSchema = object({
|
|
|
74098
74099
|
* Charging source. `'dc'` covers wall/USB adapters; `'solar'` is
|
|
74099
74100
|
* Reolink-specific for the Solar Panel 2 accessory (will become
|
|
74100
74101
|
* common on other battery cams). `'none'` means running on battery
|
|
74101
|
-
* alone.
|
|
74102
|
+
* alone — a NEGATIVE the firmware actually reported.
|
|
74103
|
+
*
|
|
74104
|
+
* `'unknown'` is the absence of an answer: the provider has not read the
|
|
74105
|
+
* power fields yet, or the firmware reported neither. Before it existed,
|
|
74106
|
+
* two unreadable fields produced `'none'`, and a camera nobody had reached
|
|
74107
|
+
* was drawn "on battery alone" — the same D315 defect `percentage` closed
|
|
74108
|
+
* by going nullable. Consumers SKIP it (no charger state published, no
|
|
74109
|
+
* glyph, no HomeKit ChargingState) rather than coerce it either way.
|
|
74102
74110
|
*/
|
|
74103
74111
|
charging: _enum([
|
|
74104
74112
|
"dc",
|
|
74105
74113
|
"solar",
|
|
74106
|
-
"none"
|
|
74114
|
+
"none",
|
|
74115
|
+
"unknown"
|
|
74107
74116
|
]),
|
|
74108
74117
|
/**
|
|
74109
74118
|
* True when the camera firmware has gone into low-power mode. Battery
|
|
@@ -74193,7 +74202,7 @@ onStatusChanged: { data: object({
|
|
|
74193
74202
|
kind: "push",
|
|
74194
74203
|
empty: {
|
|
74195
74204
|
percentage: 0,
|
|
74196
|
-
charging: "
|
|
74205
|
+
charging: "unknown",
|
|
74197
74206
|
sleeping: false,
|
|
74198
74207
|
lastUpdated: 0
|
|
74199
74208
|
}
|
|
@@ -83626,13 +83635,30 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
83626
83635
|
async onRestoreDevices(savedDevices) {
|
|
83627
83636
|
const restored = /* @__PURE__ */ new Set();
|
|
83628
83637
|
const failures = [];
|
|
83638
|
+
const liveStableIds = new Set((await this.ctx.kernel.devices.getAll()).map((device) => device.stableId));
|
|
83629
83639
|
const attemptRestore = async (saved) => {
|
|
83630
83640
|
if (restored.has(saved.id)) return;
|
|
83641
|
+
if (liveStableIds.has(saved.stableId)) {
|
|
83642
|
+
this.ctx.logger.debug("Restore row already live — not dialled again", { tags: {
|
|
83643
|
+
deviceId: saved.id,
|
|
83644
|
+
stableId: saved.stableId
|
|
83645
|
+
} });
|
|
83646
|
+
restored.add(saved.id);
|
|
83647
|
+
return;
|
|
83648
|
+
}
|
|
83631
83649
|
const Class = this.deviceClasses[saved.type];
|
|
83632
83650
|
if (!Class) throw new Error(`no device class registered for type "${saved.type}"`);
|
|
83633
83651
|
if (saved.parentDeviceId !== null && !restored.has(saved.parentDeviceId)) throw new Error(`parent device ${saved.parentDeviceId} not restored`);
|
|
83634
83652
|
await this.healSavedConfig(saved, savedDevices);
|
|
83635
|
-
|
|
83653
|
+
try {
|
|
83654
|
+
await this.ctx.kernel.devices.create(saved.stableId, Class, {}, saved.parentDeviceId);
|
|
83655
|
+
} catch (err) {
|
|
83656
|
+
if (!(await this.ctx.kernel.devices.getAll()).some((device) => device.stableId === saved.stableId)) throw err;
|
|
83657
|
+
this.ctx.logger.debug("Restore row came to life during its own dial — kept", { tags: {
|
|
83658
|
+
deviceId: saved.id,
|
|
83659
|
+
stableId: saved.stableId
|
|
83660
|
+
} });
|
|
83661
|
+
}
|
|
83636
83662
|
restored.add(saved.id);
|
|
83637
83663
|
};
|
|
83638
83664
|
const topLevel = savedDevices.filter((saved) => saved.parentDeviceId === null);
|
package/dist/addon.mjs
CHANGED
|
@@ -58058,7 +58058,8 @@ var CameraSwitchAuthoritySchema = discriminatedUnion("kind", [
|
|
|
58058
58058
|
var CameraSwitchUnavailableReasonSchema = _enum([
|
|
58059
58059
|
"no-provider",
|
|
58060
58060
|
"source-unreachable",
|
|
58061
|
-
"not-configured"
|
|
58061
|
+
"not-configured",
|
|
58062
|
+
"device-disabled"
|
|
58062
58063
|
]);
|
|
58063
58064
|
/**
|
|
58064
58065
|
* One switch, resolved for one camera.
|
|
@@ -74098,12 +74099,20 @@ var BatteryStatusSchema = object({
|
|
|
74098
74099
|
* Charging source. `'dc'` covers wall/USB adapters; `'solar'` is
|
|
74099
74100
|
* Reolink-specific for the Solar Panel 2 accessory (will become
|
|
74100
74101
|
* common on other battery cams). `'none'` means running on battery
|
|
74101
|
-
* alone.
|
|
74102
|
+
* alone — a NEGATIVE the firmware actually reported.
|
|
74103
|
+
*
|
|
74104
|
+
* `'unknown'` is the absence of an answer: the provider has not read the
|
|
74105
|
+
* power fields yet, or the firmware reported neither. Before it existed,
|
|
74106
|
+
* two unreadable fields produced `'none'`, and a camera nobody had reached
|
|
74107
|
+
* was drawn "on battery alone" — the same D315 defect `percentage` closed
|
|
74108
|
+
* by going nullable. Consumers SKIP it (no charger state published, no
|
|
74109
|
+
* glyph, no HomeKit ChargingState) rather than coerce it either way.
|
|
74102
74110
|
*/
|
|
74103
74111
|
charging: _enum([
|
|
74104
74112
|
"dc",
|
|
74105
74113
|
"solar",
|
|
74106
|
-
"none"
|
|
74114
|
+
"none",
|
|
74115
|
+
"unknown"
|
|
74107
74116
|
]),
|
|
74108
74117
|
/**
|
|
74109
74118
|
* True when the camera firmware has gone into low-power mode. Battery
|
|
@@ -74193,7 +74202,7 @@ onStatusChanged: { data: object({
|
|
|
74193
74202
|
kind: "push",
|
|
74194
74203
|
empty: {
|
|
74195
74204
|
percentage: 0,
|
|
74196
|
-
charging: "
|
|
74205
|
+
charging: "unknown",
|
|
74197
74206
|
sleeping: false,
|
|
74198
74207
|
lastUpdated: 0
|
|
74199
74208
|
}
|
|
@@ -83626,13 +83635,30 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
83626
83635
|
async onRestoreDevices(savedDevices) {
|
|
83627
83636
|
const restored = /* @__PURE__ */ new Set();
|
|
83628
83637
|
const failures = [];
|
|
83638
|
+
const liveStableIds = new Set((await this.ctx.kernel.devices.getAll()).map((device) => device.stableId));
|
|
83629
83639
|
const attemptRestore = async (saved) => {
|
|
83630
83640
|
if (restored.has(saved.id)) return;
|
|
83641
|
+
if (liveStableIds.has(saved.stableId)) {
|
|
83642
|
+
this.ctx.logger.debug("Restore row already live — not dialled again", { tags: {
|
|
83643
|
+
deviceId: saved.id,
|
|
83644
|
+
stableId: saved.stableId
|
|
83645
|
+
} });
|
|
83646
|
+
restored.add(saved.id);
|
|
83647
|
+
return;
|
|
83648
|
+
}
|
|
83631
83649
|
const Class = this.deviceClasses[saved.type];
|
|
83632
83650
|
if (!Class) throw new Error(`no device class registered for type "${saved.type}"`);
|
|
83633
83651
|
if (saved.parentDeviceId !== null && !restored.has(saved.parentDeviceId)) throw new Error(`parent device ${saved.parentDeviceId} not restored`);
|
|
83634
83652
|
await this.healSavedConfig(saved, savedDevices);
|
|
83635
|
-
|
|
83653
|
+
try {
|
|
83654
|
+
await this.ctx.kernel.devices.create(saved.stableId, Class, {}, saved.parentDeviceId);
|
|
83655
|
+
} catch (err) {
|
|
83656
|
+
if (!(await this.ctx.kernel.devices.getAll()).some((device) => device.stableId === saved.stableId)) throw err;
|
|
83657
|
+
this.ctx.logger.debug("Restore row came to life during its own dial — kept", { tags: {
|
|
83658
|
+
deviceId: saved.id,
|
|
83659
|
+
stableId: saved.stableId
|
|
83660
|
+
} });
|
|
83661
|
+
}
|
|
83636
83662
|
restored.add(saved.id);
|
|
83637
83663
|
};
|
|
83638
83664
|
const topLevel = savedDevices.filter((saved) => saved.parentDeviceId === null);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-provider-dreame",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.67",
|
|
4
4
|
"description": "Dreame robot-vacuum / lawn-mower device-provider addon for CamStack — wraps the @apocaliss92/nodedreame Dreamehome cloud client",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|