@camstack/addon-provider-velux 0.2.64 → 0.2.66
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 +28 -5
- package/dist/addon.mjs +28 -5
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -7553,7 +7553,8 @@ var CameraSwitchAuthoritySchema = discriminatedUnion("kind", [
|
|
|
7553
7553
|
var CameraSwitchUnavailableReasonSchema = _enum([
|
|
7554
7554
|
"no-provider",
|
|
7555
7555
|
"source-unreachable",
|
|
7556
|
-
"not-configured"
|
|
7556
|
+
"not-configured",
|
|
7557
|
+
"device-disabled"
|
|
7557
7558
|
]);
|
|
7558
7559
|
/**
|
|
7559
7560
|
* One switch, resolved for one camera.
|
|
@@ -13043,7 +13044,12 @@ var ConfigEntrySchema = object({
|
|
|
13043
13044
|
value: unknown(),
|
|
13044
13045
|
description: string().optional()
|
|
13045
13046
|
});
|
|
13046
|
-
|
|
13047
|
+
/**
|
|
13048
|
+
* Only `manual` since D356: the operator picks, nothing links itself. The
|
|
13049
|
+
* field survives on the wire because a viewer already OTA'd parses it —
|
|
13050
|
+
* drop it once no shipped client reads `mode`.
|
|
13051
|
+
*/
|
|
13052
|
+
var LinkedDevicesModeSchema = _enum(["manual"]);
|
|
13047
13053
|
/** One resolved linked device — the compact projection consumers need. */
|
|
13048
13054
|
var LinkedDeviceSchema = object({
|
|
13049
13055
|
deviceId: number(),
|
|
@@ -23571,12 +23577,20 @@ var BatteryStatusSchema = object({
|
|
|
23571
23577
|
* Charging source. `'dc'` covers wall/USB adapters; `'solar'` is
|
|
23572
23578
|
* Reolink-specific for the Solar Panel 2 accessory (will become
|
|
23573
23579
|
* common on other battery cams). `'none'` means running on battery
|
|
23574
|
-
* alone.
|
|
23580
|
+
* alone — a NEGATIVE the firmware actually reported.
|
|
23581
|
+
*
|
|
23582
|
+
* `'unknown'` is the absence of an answer: the provider has not read the
|
|
23583
|
+
* power fields yet, or the firmware reported neither. Before it existed,
|
|
23584
|
+
* two unreadable fields produced `'none'`, and a camera nobody had reached
|
|
23585
|
+
* was drawn "on battery alone" — the same D315 defect `percentage` closed
|
|
23586
|
+
* by going nullable. Consumers SKIP it (no charger state published, no
|
|
23587
|
+
* glyph, no HomeKit ChargingState) rather than coerce it either way.
|
|
23575
23588
|
*/
|
|
23576
23589
|
charging: _enum([
|
|
23577
23590
|
"dc",
|
|
23578
23591
|
"solar",
|
|
23579
|
-
"none"
|
|
23592
|
+
"none",
|
|
23593
|
+
"unknown"
|
|
23580
23594
|
]),
|
|
23581
23595
|
/**
|
|
23582
23596
|
* True when the camera firmware has gone into low-power mode. Battery
|
|
@@ -23666,7 +23680,7 @@ onStatusChanged: { data: object({
|
|
|
23666
23680
|
kind: "push",
|
|
23667
23681
|
empty: {
|
|
23668
23682
|
percentage: 0,
|
|
23669
|
-
charging: "
|
|
23683
|
+
charging: "unknown",
|
|
23670
23684
|
sleeping: false,
|
|
23671
23685
|
lastUpdated: 0
|
|
23672
23686
|
}
|
|
@@ -33074,8 +33088,17 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
33074
33088
|
async onRestoreDevices(savedDevices) {
|
|
33075
33089
|
const restored = /* @__PURE__ */ new Set();
|
|
33076
33090
|
const failures = [];
|
|
33091
|
+
const liveStableIds = new Set((await this.ctx.kernel.devices.getAll()).map((device) => device.stableId));
|
|
33077
33092
|
const attemptRestore = async (saved) => {
|
|
33078
33093
|
if (restored.has(saved.id)) return;
|
|
33094
|
+
if (liveStableIds.has(saved.stableId)) {
|
|
33095
|
+
this.ctx.logger.debug("Restore row already live — not dialled again", { tags: {
|
|
33096
|
+
deviceId: saved.id,
|
|
33097
|
+
stableId: saved.stableId
|
|
33098
|
+
} });
|
|
33099
|
+
restored.add(saved.id);
|
|
33100
|
+
return;
|
|
33101
|
+
}
|
|
33079
33102
|
const Class = this.deviceClasses[saved.type];
|
|
33080
33103
|
if (!Class) throw new Error(`no device class registered for type "${saved.type}"`);
|
|
33081
33104
|
if (saved.parentDeviceId !== null && !restored.has(saved.parentDeviceId)) throw new Error(`parent device ${saved.parentDeviceId} not restored`);
|
package/dist/addon.mjs
CHANGED
|
@@ -7552,7 +7552,8 @@ var CameraSwitchAuthoritySchema = discriminatedUnion("kind", [
|
|
|
7552
7552
|
var CameraSwitchUnavailableReasonSchema = _enum([
|
|
7553
7553
|
"no-provider",
|
|
7554
7554
|
"source-unreachable",
|
|
7555
|
-
"not-configured"
|
|
7555
|
+
"not-configured",
|
|
7556
|
+
"device-disabled"
|
|
7556
7557
|
]);
|
|
7557
7558
|
/**
|
|
7558
7559
|
* One switch, resolved for one camera.
|
|
@@ -13042,7 +13043,12 @@ var ConfigEntrySchema = object({
|
|
|
13042
13043
|
value: unknown(),
|
|
13043
13044
|
description: string().optional()
|
|
13044
13045
|
});
|
|
13045
|
-
|
|
13046
|
+
/**
|
|
13047
|
+
* Only `manual` since D356: the operator picks, nothing links itself. The
|
|
13048
|
+
* field survives on the wire because a viewer already OTA'd parses it —
|
|
13049
|
+
* drop it once no shipped client reads `mode`.
|
|
13050
|
+
*/
|
|
13051
|
+
var LinkedDevicesModeSchema = _enum(["manual"]);
|
|
13046
13052
|
/** One resolved linked device — the compact projection consumers need. */
|
|
13047
13053
|
var LinkedDeviceSchema = object({
|
|
13048
13054
|
deviceId: number(),
|
|
@@ -23570,12 +23576,20 @@ var BatteryStatusSchema = object({
|
|
|
23570
23576
|
* Charging source. `'dc'` covers wall/USB adapters; `'solar'` is
|
|
23571
23577
|
* Reolink-specific for the Solar Panel 2 accessory (will become
|
|
23572
23578
|
* common on other battery cams). `'none'` means running on battery
|
|
23573
|
-
* alone.
|
|
23579
|
+
* alone — a NEGATIVE the firmware actually reported.
|
|
23580
|
+
*
|
|
23581
|
+
* `'unknown'` is the absence of an answer: the provider has not read the
|
|
23582
|
+
* power fields yet, or the firmware reported neither. Before it existed,
|
|
23583
|
+
* two unreadable fields produced `'none'`, and a camera nobody had reached
|
|
23584
|
+
* was drawn "on battery alone" — the same D315 defect `percentage` closed
|
|
23585
|
+
* by going nullable. Consumers SKIP it (no charger state published, no
|
|
23586
|
+
* glyph, no HomeKit ChargingState) rather than coerce it either way.
|
|
23574
23587
|
*/
|
|
23575
23588
|
charging: _enum([
|
|
23576
23589
|
"dc",
|
|
23577
23590
|
"solar",
|
|
23578
|
-
"none"
|
|
23591
|
+
"none",
|
|
23592
|
+
"unknown"
|
|
23579
23593
|
]),
|
|
23580
23594
|
/**
|
|
23581
23595
|
* True when the camera firmware has gone into low-power mode. Battery
|
|
@@ -23665,7 +23679,7 @@ onStatusChanged: { data: object({
|
|
|
23665
23679
|
kind: "push",
|
|
23666
23680
|
empty: {
|
|
23667
23681
|
percentage: 0,
|
|
23668
|
-
charging: "
|
|
23682
|
+
charging: "unknown",
|
|
23669
23683
|
sleeping: false,
|
|
23670
23684
|
lastUpdated: 0
|
|
23671
23685
|
}
|
|
@@ -33073,8 +33087,17 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
33073
33087
|
async onRestoreDevices(savedDevices) {
|
|
33074
33088
|
const restored = /* @__PURE__ */ new Set();
|
|
33075
33089
|
const failures = [];
|
|
33090
|
+
const liveStableIds = new Set((await this.ctx.kernel.devices.getAll()).map((device) => device.stableId));
|
|
33076
33091
|
const attemptRestore = async (saved) => {
|
|
33077
33092
|
if (restored.has(saved.id)) return;
|
|
33093
|
+
if (liveStableIds.has(saved.stableId)) {
|
|
33094
|
+
this.ctx.logger.debug("Restore row already live — not dialled again", { tags: {
|
|
33095
|
+
deviceId: saved.id,
|
|
33096
|
+
stableId: saved.stableId
|
|
33097
|
+
} });
|
|
33098
|
+
restored.add(saved.id);
|
|
33099
|
+
return;
|
|
33100
|
+
}
|
|
33078
33101
|
const Class = this.deviceClasses[saved.type];
|
|
33079
33102
|
if (!Class) throw new Error(`no device class registered for type "${saved.type}"`);
|
|
33080
33103
|
if (saved.parentDeviceId !== null && !restored.has(saved.parentDeviceId)) throw new Error(`parent device ${saved.parentDeviceId} not restored`);
|
package/package.json
CHANGED