@camstack/addon-provider-gree 0.2.65 → 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 +9 -1
- package/dist/addon.mjs +9 -1
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -33106,7 +33106,15 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
33106
33106
|
if (!Class) throw new Error(`no device class registered for type "${saved.type}"`);
|
|
33107
33107
|
if (saved.parentDeviceId !== null && !restored.has(saved.parentDeviceId)) throw new Error(`parent device ${saved.parentDeviceId} not restored`);
|
|
33108
33108
|
await this.healSavedConfig(saved, savedDevices);
|
|
33109
|
-
|
|
33109
|
+
try {
|
|
33110
|
+
await this.ctx.kernel.devices.create(saved.stableId, Class, {}, saved.parentDeviceId);
|
|
33111
|
+
} catch (err) {
|
|
33112
|
+
if (!(await this.ctx.kernel.devices.getAll()).some((device) => device.stableId === saved.stableId)) throw err;
|
|
33113
|
+
this.ctx.logger.debug("Restore row came to life during its own dial — kept", { tags: {
|
|
33114
|
+
deviceId: saved.id,
|
|
33115
|
+
stableId: saved.stableId
|
|
33116
|
+
} });
|
|
33117
|
+
}
|
|
33110
33118
|
restored.add(saved.id);
|
|
33111
33119
|
};
|
|
33112
33120
|
const topLevel = savedDevices.filter((saved) => saved.parentDeviceId === null);
|
package/dist/addon.mjs
CHANGED
|
@@ -33105,7 +33105,15 @@ var BaseDeviceProvider = class extends BaseAddon {
|
|
|
33105
33105
|
if (!Class) throw new Error(`no device class registered for type "${saved.type}"`);
|
|
33106
33106
|
if (saved.parentDeviceId !== null && !restored.has(saved.parentDeviceId)) throw new Error(`parent device ${saved.parentDeviceId} not restored`);
|
|
33107
33107
|
await this.healSavedConfig(saved, savedDevices);
|
|
33108
|
-
|
|
33108
|
+
try {
|
|
33109
|
+
await this.ctx.kernel.devices.create(saved.stableId, Class, {}, saved.parentDeviceId);
|
|
33110
|
+
} catch (err) {
|
|
33111
|
+
if (!(await this.ctx.kernel.devices.getAll()).some((device) => device.stableId === saved.stableId)) throw err;
|
|
33112
|
+
this.ctx.logger.debug("Restore row came to life during its own dial — kept", { tags: {
|
|
33113
|
+
deviceId: saved.id,
|
|
33114
|
+
stableId: saved.stableId
|
|
33115
|
+
} });
|
|
33116
|
+
}
|
|
33109
33117
|
restored.add(saved.id);
|
|
33110
33118
|
};
|
|
33111
33119
|
const topLevel = savedDevices.filter((saved) => saved.parentDeviceId === null);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-provider-gree",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.66",
|
|
4
4
|
"description": "Gree air-conditioner device-provider addon for CamStack — wraps the @apocaliss92/nodegree local-UDP client (LAN discovery + AES control), exposing climate-control and fan-control",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|