@camstack/addon-provider-homematic 1.2.66 → 1.2.68
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
|
@@ -7562,7 +7562,8 @@ var CameraSwitchAuthoritySchema = discriminatedUnion("kind", [
|
|
|
7562
7562
|
var CameraSwitchUnavailableReasonSchema = _enum([
|
|
7563
7563
|
"no-provider",
|
|
7564
7564
|
"source-unreachable",
|
|
7565
|
-
"not-configured"
|
|
7565
|
+
"not-configured",
|
|
7566
|
+
"device-disabled"
|
|
7566
7567
|
]);
|
|
7567
7568
|
/**
|
|
7568
7569
|
* One switch, resolved for one camera.
|
|
@@ -23651,12 +23652,20 @@ var BatteryStatusSchema = object({
|
|
|
23651
23652
|
* Charging source. `'dc'` covers wall/USB adapters; `'solar'` is
|
|
23652
23653
|
* Reolink-specific for the Solar Panel 2 accessory (will become
|
|
23653
23654
|
* common on other battery cams). `'none'` means running on battery
|
|
23654
|
-
* alone.
|
|
23655
|
+
* alone — a NEGATIVE the firmware actually reported.
|
|
23656
|
+
*
|
|
23657
|
+
* `'unknown'` is the absence of an answer: the provider has not read the
|
|
23658
|
+
* power fields yet, or the firmware reported neither. Before it existed,
|
|
23659
|
+
* two unreadable fields produced `'none'`, and a camera nobody had reached
|
|
23660
|
+
* was drawn "on battery alone" — the same D315 defect `percentage` closed
|
|
23661
|
+
* by going nullable. Consumers SKIP it (no charger state published, no
|
|
23662
|
+
* glyph, no HomeKit ChargingState) rather than coerce it either way.
|
|
23655
23663
|
*/
|
|
23656
23664
|
charging: _enum([
|
|
23657
23665
|
"dc",
|
|
23658
23666
|
"solar",
|
|
23659
|
-
"none"
|
|
23667
|
+
"none",
|
|
23668
|
+
"unknown"
|
|
23660
23669
|
]),
|
|
23661
23670
|
/**
|
|
23662
23671
|
* True when the camera firmware has gone into low-power mode. Battery
|
|
@@ -23746,7 +23755,7 @@ onStatusChanged: { data: object({
|
|
|
23746
23755
|
kind: "push",
|
|
23747
23756
|
empty: {
|
|
23748
23757
|
percentage: 0,
|
|
23749
|
-
charging: "
|
|
23758
|
+
charging: "unknown",
|
|
23750
23759
|
sleeping: false,
|
|
23751
23760
|
lastUpdated: 0
|
|
23752
23761
|
}
|
|
@@ -33154,13 +33163,30 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
33154
33163
|
async onRestoreDevices(savedDevices) {
|
|
33155
33164
|
const restored = /* @__PURE__ */ new Set();
|
|
33156
33165
|
const failures = [];
|
|
33166
|
+
const liveStableIds = new Set((await this.ctx.kernel.devices.getAll()).map((device) => device.stableId));
|
|
33157
33167
|
const attemptRestore = async (saved) => {
|
|
33158
33168
|
if (restored.has(saved.id)) return;
|
|
33169
|
+
if (liveStableIds.has(saved.stableId)) {
|
|
33170
|
+
this.ctx.logger.debug("Restore row already live — not dialled again", { tags: {
|
|
33171
|
+
deviceId: saved.id,
|
|
33172
|
+
stableId: saved.stableId
|
|
33173
|
+
} });
|
|
33174
|
+
restored.add(saved.id);
|
|
33175
|
+
return;
|
|
33176
|
+
}
|
|
33159
33177
|
const Class = this.deviceClasses[saved.type];
|
|
33160
33178
|
if (!Class) throw new Error(`no device class registered for type "${saved.type}"`);
|
|
33161
33179
|
if (saved.parentDeviceId !== null && !restored.has(saved.parentDeviceId)) throw new Error(`parent device ${saved.parentDeviceId} not restored`);
|
|
33162
33180
|
await this.healSavedConfig(saved, savedDevices);
|
|
33163
|
-
|
|
33181
|
+
try {
|
|
33182
|
+
await this.ctx.kernel.devices.create(saved.stableId, Class, {}, saved.parentDeviceId);
|
|
33183
|
+
} catch (err) {
|
|
33184
|
+
if (!(await this.ctx.kernel.devices.getAll()).some((device) => device.stableId === saved.stableId)) throw err;
|
|
33185
|
+
this.ctx.logger.debug("Restore row came to life during its own dial — kept", { tags: {
|
|
33186
|
+
deviceId: saved.id,
|
|
33187
|
+
stableId: saved.stableId
|
|
33188
|
+
} });
|
|
33189
|
+
}
|
|
33164
33190
|
restored.add(saved.id);
|
|
33165
33191
|
};
|
|
33166
33192
|
const topLevel = savedDevices.filter((saved) => saved.parentDeviceId === null);
|
package/dist/addon.mjs
CHANGED
|
@@ -7563,7 +7563,8 @@ var CameraSwitchAuthoritySchema = discriminatedUnion("kind", [
|
|
|
7563
7563
|
var CameraSwitchUnavailableReasonSchema = _enum([
|
|
7564
7564
|
"no-provider",
|
|
7565
7565
|
"source-unreachable",
|
|
7566
|
-
"not-configured"
|
|
7566
|
+
"not-configured",
|
|
7567
|
+
"device-disabled"
|
|
7567
7568
|
]);
|
|
7568
7569
|
/**
|
|
7569
7570
|
* One switch, resolved for one camera.
|
|
@@ -23652,12 +23653,20 @@ var BatteryStatusSchema = object({
|
|
|
23652
23653
|
* Charging source. `'dc'` covers wall/USB adapters; `'solar'` is
|
|
23653
23654
|
* Reolink-specific for the Solar Panel 2 accessory (will become
|
|
23654
23655
|
* common on other battery cams). `'none'` means running on battery
|
|
23655
|
-
* alone.
|
|
23656
|
+
* alone — a NEGATIVE the firmware actually reported.
|
|
23657
|
+
*
|
|
23658
|
+
* `'unknown'` is the absence of an answer: the provider has not read the
|
|
23659
|
+
* power fields yet, or the firmware reported neither. Before it existed,
|
|
23660
|
+
* two unreadable fields produced `'none'`, and a camera nobody had reached
|
|
23661
|
+
* was drawn "on battery alone" — the same D315 defect `percentage` closed
|
|
23662
|
+
* by going nullable. Consumers SKIP it (no charger state published, no
|
|
23663
|
+
* glyph, no HomeKit ChargingState) rather than coerce it either way.
|
|
23656
23664
|
*/
|
|
23657
23665
|
charging: _enum([
|
|
23658
23666
|
"dc",
|
|
23659
23667
|
"solar",
|
|
23660
|
-
"none"
|
|
23668
|
+
"none",
|
|
23669
|
+
"unknown"
|
|
23661
23670
|
]),
|
|
23662
23671
|
/**
|
|
23663
23672
|
* True when the camera firmware has gone into low-power mode. Battery
|
|
@@ -23747,7 +23756,7 @@ onStatusChanged: { data: object({
|
|
|
23747
23756
|
kind: "push",
|
|
23748
23757
|
empty: {
|
|
23749
23758
|
percentage: 0,
|
|
23750
|
-
charging: "
|
|
23759
|
+
charging: "unknown",
|
|
23751
23760
|
sleeping: false,
|
|
23752
23761
|
lastUpdated: 0
|
|
23753
23762
|
}
|
|
@@ -33155,13 +33164,30 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
33155
33164
|
async onRestoreDevices(savedDevices) {
|
|
33156
33165
|
const restored = /* @__PURE__ */ new Set();
|
|
33157
33166
|
const failures = [];
|
|
33167
|
+
const liveStableIds = new Set((await this.ctx.kernel.devices.getAll()).map((device) => device.stableId));
|
|
33158
33168
|
const attemptRestore = async (saved) => {
|
|
33159
33169
|
if (restored.has(saved.id)) return;
|
|
33170
|
+
if (liveStableIds.has(saved.stableId)) {
|
|
33171
|
+
this.ctx.logger.debug("Restore row already live — not dialled again", { tags: {
|
|
33172
|
+
deviceId: saved.id,
|
|
33173
|
+
stableId: saved.stableId
|
|
33174
|
+
} });
|
|
33175
|
+
restored.add(saved.id);
|
|
33176
|
+
return;
|
|
33177
|
+
}
|
|
33160
33178
|
const Class = this.deviceClasses[saved.type];
|
|
33161
33179
|
if (!Class) throw new Error(`no device class registered for type "${saved.type}"`);
|
|
33162
33180
|
if (saved.parentDeviceId !== null && !restored.has(saved.parentDeviceId)) throw new Error(`parent device ${saved.parentDeviceId} not restored`);
|
|
33163
33181
|
await this.healSavedConfig(saved, savedDevices);
|
|
33164
|
-
|
|
33182
|
+
try {
|
|
33183
|
+
await this.ctx.kernel.devices.create(saved.stableId, Class, {}, saved.parentDeviceId);
|
|
33184
|
+
} catch (err) {
|
|
33185
|
+
if (!(await this.ctx.kernel.devices.getAll()).some((device) => device.stableId === saved.stableId)) throw err;
|
|
33186
|
+
this.ctx.logger.debug("Restore row came to life during its own dial — kept", { tags: {
|
|
33187
|
+
deviceId: saved.id,
|
|
33188
|
+
stableId: saved.stableId
|
|
33189
|
+
} });
|
|
33190
|
+
}
|
|
33165
33191
|
restored.add(saved.id);
|
|
33166
33192
|
};
|
|
33167
33193
|
const topLevel = savedDevices.filter((saved) => saved.parentDeviceId === null);
|
package/package.json
CHANGED