@attraccess/plugin-shelly 0.1.0 → 0.2.0
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/LICENSE.md +14 -0
- package/dist/index.js +116 -125
- package/frontend/{__federation_expose_Plugin-CLiHEWPT.js → __federation_expose_Plugin-XVfbDNc5.js} +371 -451
- package/frontend/__federation_fn_import-BHGw2mzr.js +1 -0
- package/frontend/{_virtual___federation_fn_import-BXODRNto.js → _virtual___federation_fn_import-D2E5es2p.js} +2 -4
- package/frontend/remoteEntry.js +3 -71
- package/frontend/style.css +2 -22
- package/package.json +14 -12
- package/dist/migrations.js +0 -57
- package/frontend/__federation_fn_import-DAGm_xmC.js +0 -2
package/LICENSE.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Lizenz von @attraccess/plugin-shelly
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Jan Jaap (Github: JappyJan, E-Mail: mail@janjaap.de)
|
|
4
|
+
Project: Attraccess
|
|
5
|
+
|
|
6
|
+
Dieses Plugin hat keine eigene Lizenz. Es steht unter der Lizenz des Attraccess-Kerns, der **Prosperity Public License 3.0 – Modified Version**. Der vollständige Text steht in der Datei [LICENSE.md im Repository-Stamm](https://github.com/Attraccess/Attraccess/blob/main/LICENSE.md).
|
|
7
|
+
|
|
8
|
+
Kurz zusammengefasst (maßgeblich ist allein der Text der Kernlizenz):
|
|
9
|
+
|
|
10
|
+
- Kostenlos für Privatpersonen und gemeinnützige Organisationen, für nicht-kommerzielle Zwecke.
|
|
11
|
+
- Kommerzielle Nutzer dürfen 30 Tage kostenlos evaluieren, danach ist eine kommerzielle Lizenz erforderlich.
|
|
12
|
+
- Forks und abgeleitete Werke nur unter exakt denselben Lizenzbedingungen.
|
|
13
|
+
|
|
14
|
+
Für kommerzielle Lizenzen: [contact@attraccess.org](mailto:contact@attraccess.org)
|
package/dist/index.js
CHANGED
|
@@ -2737,19 +2737,19 @@ var require_isReadableStreamLike = __commonJS({
|
|
|
2737
2737
|
var _ = { label: 0, sent: function() {
|
|
2738
2738
|
if (t[0] & 1) throw t[1];
|
|
2739
2739
|
return t[1];
|
|
2740
|
-
}, trys: [], ops: [] },
|
|
2740
|
+
}, trys: [], ops: [] }, f2, y, t, g;
|
|
2741
2741
|
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
2742
2742
|
return this;
|
|
2743
2743
|
}), g;
|
|
2744
2744
|
function verb(n) {
|
|
2745
2745
|
return function(v) {
|
|
2746
|
-
return
|
|
2746
|
+
return step2([n, v]);
|
|
2747
2747
|
};
|
|
2748
2748
|
}
|
|
2749
|
-
function
|
|
2750
|
-
if (
|
|
2749
|
+
function step2(op) {
|
|
2750
|
+
if (f2) throw new TypeError("Generator is already executing.");
|
|
2751
2751
|
while (_) try {
|
|
2752
|
-
if (
|
|
2752
|
+
if (f2 = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
2753
2753
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
2754
2754
|
switch (op[0]) {
|
|
2755
2755
|
case 0:
|
|
@@ -2796,7 +2796,7 @@ var require_isReadableStreamLike = __commonJS({
|
|
|
2796
2796
|
op = [6, e];
|
|
2797
2797
|
y = 0;
|
|
2798
2798
|
} finally {
|
|
2799
|
-
|
|
2799
|
+
f2 = t = 0;
|
|
2800
2800
|
}
|
|
2801
2801
|
if (op[0] & 5) throw op[1];
|
|
2802
2802
|
return { value: op[0] ? op[1] : void 0, done: true };
|
|
@@ -2820,12 +2820,12 @@ var require_isReadableStreamLike = __commonJS({
|
|
|
2820
2820
|
}
|
|
2821
2821
|
function resume(n, v) {
|
|
2822
2822
|
try {
|
|
2823
|
-
|
|
2823
|
+
step2(g[n](v));
|
|
2824
2824
|
} catch (e) {
|
|
2825
2825
|
settle(q[0][3], e);
|
|
2826
2826
|
}
|
|
2827
2827
|
}
|
|
2828
|
-
function
|
|
2828
|
+
function step2(r) {
|
|
2829
2829
|
r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r);
|
|
2830
2830
|
}
|
|
2831
2831
|
function fulfill(value) {
|
|
@@ -2834,8 +2834,8 @@ var require_isReadableStreamLike = __commonJS({
|
|
|
2834
2834
|
function reject(value) {
|
|
2835
2835
|
resume("throw", value);
|
|
2836
2836
|
}
|
|
2837
|
-
function settle(
|
|
2838
|
-
if (
|
|
2837
|
+
function settle(f2, v) {
|
|
2838
|
+
if (f2(v), q.shift(), q.length) resume(q[0][0], q[0][1]);
|
|
2839
2839
|
}
|
|
2840
2840
|
};
|
|
2841
2841
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
@@ -2900,41 +2900,41 @@ var require_innerFrom = __commonJS({
|
|
|
2900
2900
|
return new (P || (P = Promise))(function(resolve, reject) {
|
|
2901
2901
|
function fulfilled(value) {
|
|
2902
2902
|
try {
|
|
2903
|
-
|
|
2903
|
+
step2(generator.next(value));
|
|
2904
2904
|
} catch (e) {
|
|
2905
2905
|
reject(e);
|
|
2906
2906
|
}
|
|
2907
2907
|
}
|
|
2908
2908
|
function rejected(value) {
|
|
2909
2909
|
try {
|
|
2910
|
-
|
|
2910
|
+
step2(generator["throw"](value));
|
|
2911
2911
|
} catch (e) {
|
|
2912
2912
|
reject(e);
|
|
2913
2913
|
}
|
|
2914
2914
|
}
|
|
2915
|
-
function
|
|
2915
|
+
function step2(result) {
|
|
2916
2916
|
result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
2917
2917
|
}
|
|
2918
|
-
|
|
2918
|
+
step2((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
2919
2919
|
});
|
|
2920
2920
|
};
|
|
2921
2921
|
var __generator = exports2 && exports2.__generator || function(thisArg, body) {
|
|
2922
2922
|
var _ = { label: 0, sent: function() {
|
|
2923
2923
|
if (t[0] & 1) throw t[1];
|
|
2924
2924
|
return t[1];
|
|
2925
|
-
}, trys: [], ops: [] },
|
|
2925
|
+
}, trys: [], ops: [] }, f2, y, t, g;
|
|
2926
2926
|
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
2927
2927
|
return this;
|
|
2928
2928
|
}), g;
|
|
2929
2929
|
function verb(n) {
|
|
2930
2930
|
return function(v) {
|
|
2931
|
-
return
|
|
2931
|
+
return step2([n, v]);
|
|
2932
2932
|
};
|
|
2933
2933
|
}
|
|
2934
|
-
function
|
|
2935
|
-
if (
|
|
2934
|
+
function step2(op) {
|
|
2935
|
+
if (f2) throw new TypeError("Generator is already executing.");
|
|
2936
2936
|
while (_) try {
|
|
2937
|
-
if (
|
|
2937
|
+
if (f2 = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
2938
2938
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
2939
2939
|
switch (op[0]) {
|
|
2940
2940
|
case 0:
|
|
@@ -2981,7 +2981,7 @@ var require_innerFrom = __commonJS({
|
|
|
2981
2981
|
op = [6, e];
|
|
2982
2982
|
y = 0;
|
|
2983
2983
|
} finally {
|
|
2984
|
-
|
|
2984
|
+
f2 = t = 0;
|
|
2985
2985
|
}
|
|
2986
2986
|
if (op[0] & 5) throw op[1];
|
|
2987
2987
|
return { value: op[0] ? op[1] : void 0, done: true };
|
|
@@ -4536,19 +4536,19 @@ var require_generate = __commonJS({
|
|
|
4536
4536
|
var _ = { label: 0, sent: function() {
|
|
4537
4537
|
if (t[0] & 1) throw t[1];
|
|
4538
4538
|
return t[1];
|
|
4539
|
-
}, trys: [], ops: [] },
|
|
4539
|
+
}, trys: [], ops: [] }, f2, y, t, g;
|
|
4540
4540
|
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
4541
4541
|
return this;
|
|
4542
4542
|
}), g;
|
|
4543
4543
|
function verb(n) {
|
|
4544
4544
|
return function(v) {
|
|
4545
|
-
return
|
|
4545
|
+
return step2([n, v]);
|
|
4546
4546
|
};
|
|
4547
4547
|
}
|
|
4548
|
-
function
|
|
4549
|
-
if (
|
|
4548
|
+
function step2(op) {
|
|
4549
|
+
if (f2) throw new TypeError("Generator is already executing.");
|
|
4550
4550
|
while (_) try {
|
|
4551
|
-
if (
|
|
4551
|
+
if (f2 = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
4552
4552
|
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
4553
4553
|
switch (op[0]) {
|
|
4554
4554
|
case 0:
|
|
@@ -4595,7 +4595,7 @@ var require_generate = __commonJS({
|
|
|
4595
4595
|
op = [6, e];
|
|
4596
4596
|
y = 0;
|
|
4597
4597
|
} finally {
|
|
4598
|
-
|
|
4598
|
+
f2 = t = 0;
|
|
4599
4599
|
}
|
|
4600
4600
|
if (op[0] & 5) throw op[1];
|
|
4601
4601
|
return { value: op[0] ? op[1] : void 0, done: true };
|
|
@@ -9451,87 +9451,72 @@ module.exports = __toCommonJS(plugin_exports);
|
|
|
9451
9451
|
// backend/devices/registry/service.ts
|
|
9452
9452
|
var import_common = require("@nestjs/common");
|
|
9453
9453
|
|
|
9454
|
-
// backend/devices/registry/
|
|
9454
|
+
// backend/devices/registry/storage.ts
|
|
9455
9455
|
var import_plugins_backend_sdk = require("@attraccess/plugins-backend-sdk");
|
|
9456
|
-
var
|
|
9457
|
-
|
|
9458
|
-
|
|
9459
|
-
|
|
9460
|
-
|
|
9461
|
-
|
|
9462
|
-
|
|
9463
|
-
|
|
9464
|
-
|
|
9465
|
-
|
|
9466
|
-
|
|
9467
|
-
|
|
9468
|
-
|
|
9469
|
-
|
|
9470
|
-
|
|
9471
|
-
|
|
9472
|
-
|
|
9473
|
-
|
|
9474
|
-
|
|
9475
|
-
|
|
9476
|
-
|
|
9477
|
-
|
|
9478
|
-
|
|
9479
|
-
|
|
9480
|
-
|
|
9481
|
-
|
|
9482
|
-
|
|
9483
|
-
|
|
9484
|
-
|
|
9485
|
-
|
|
9486
|
-
(0, import_plugins_backend_sdk.Column)({ type: "varchar", name: "auth_state", default: "unknown" })
|
|
9487
|
-
], ShellyDevice.prototype, "authState", 2);
|
|
9488
|
-
__decorateClass([
|
|
9489
|
-
(0, import_plugins_backend_sdk.Column)({ type: "varchar", name: "last_probe_at", nullable: true })
|
|
9490
|
-
], ShellyDevice.prototype, "lastProbeAt", 2);
|
|
9491
|
-
__decorateClass([
|
|
9492
|
-
(0, import_plugins_backend_sdk.Column)({ type: "varchar", name: "last_probe_error", nullable: true })
|
|
9493
|
-
], ShellyDevice.prototype, "lastProbeError", 2);
|
|
9494
|
-
__decorateClass([
|
|
9495
|
-
(0, import_plugins_backend_sdk.Column)({ type: "varchar", name: "created_at" })
|
|
9496
|
-
], ShellyDevice.prototype, "createdAt", 2);
|
|
9497
|
-
__decorateClass([
|
|
9498
|
-
(0, import_plugins_backend_sdk.Column)({ type: "varchar", name: "updated_at" })
|
|
9499
|
-
], ShellyDevice.prototype, "updatedAt", 2);
|
|
9500
|
-
ShellyDevice = __decorateClass([
|
|
9501
|
-
(0, import_plugins_backend_sdk.Entity)({ name: "plugin_shelly_devices" })
|
|
9502
|
-
], ShellyDevice);
|
|
9456
|
+
var devices = (0, import_plugins_backend_sdk.table)(
|
|
9457
|
+
{
|
|
9458
|
+
id: import_plugins_backend_sdk.f.id(),
|
|
9459
|
+
/** Operator-entered, without a length limit (like the device-reported model and the probe error). */
|
|
9460
|
+
name: import_plugins_backend_sdk.f.text(),
|
|
9461
|
+
ipAddress: import_plugins_backend_sdk.f.string({ column: "ip_address" }),
|
|
9462
|
+
/** Shelly generation: 1 for Gen1, 2/3/… for Gen2+. Null until first probe. */
|
|
9463
|
+
generation: import_plugins_backend_sdk.f.integer().optional(),
|
|
9464
|
+
/** Device model string (Gen2+ `model`, Gen1 `type`). Null until first probe. */
|
|
9465
|
+
model: import_plugins_backend_sdk.f.text().optional(),
|
|
9466
|
+
authState: import_plugins_backend_sdk.f.string({ column: "auth_state" }).withDefault("unknown"),
|
|
9467
|
+
/** ISO timestamp of the last probe attempt, or null if never attempted. */
|
|
9468
|
+
lastProbeAt: import_plugins_backend_sdk.f.string({ column: "last_probe_at" }).optional(),
|
|
9469
|
+
/** Error message from the last probe attempt, or null if the last probe succeeded. */
|
|
9470
|
+
lastProbeError: import_plugins_backend_sdk.f.text({ column: "last_probe_error" }).optional(),
|
|
9471
|
+
// Stored as ISO strings: the table predates the record port and keeps its original textual timestamp shape.
|
|
9472
|
+
createdAt: import_plugins_backend_sdk.f.string({ column: "created_at" }),
|
|
9473
|
+
updatedAt: import_plugins_backend_sdk.f.string({ column: "updated_at" })
|
|
9474
|
+
},
|
|
9475
|
+
{
|
|
9476
|
+
indexes: [{ name: "UQ_plugin_shelly_devices_ip_address", fields: ["ipAddress"], unique: true }],
|
|
9477
|
+
physicalName: "plugin_shelly_devices"
|
|
9478
|
+
}
|
|
9479
|
+
);
|
|
9480
|
+
var SHELLY_LEGACY_MIGRATIONS = ["CreateShellyDevices1749470400000"];
|
|
9481
|
+
var shellyStorage = (0, import_plugins_backend_sdk.definePluginStorage)({
|
|
9482
|
+
tables: { devices },
|
|
9483
|
+
migrations: [{ version: 1, name: "baseline", steps: [import_plugins_backend_sdk.step.createTable("devices", devices)] }],
|
|
9484
|
+
adoption: { legacyMigrations: SHELLY_LEGACY_MIGRATIONS }
|
|
9485
|
+
});
|
|
9503
9486
|
|
|
9504
9487
|
// backend/devices/registry/service.ts
|
|
9505
9488
|
var PLUGIN_CONTEXT = /* @__PURE__ */ Symbol.for("attraccess.plugin.context");
|
|
9506
9489
|
var DeviceRegistryService = class {
|
|
9507
9490
|
constructor(context) {
|
|
9508
9491
|
__publicField(this, "context", context);
|
|
9509
|
-
__publicField(this, "
|
|
9510
|
-
}
|
|
9511
|
-
//
|
|
9512
|
-
//
|
|
9513
|
-
// wired up (PluginContext.getRepository throws "Host DataSource is not
|
|
9514
|
-
// available yet" until bootstrap completes). The first query happens on an
|
|
9515
|
-
// HTTP request, well after bootstrap, so resolving on demand is safe; cache it
|
|
9516
|
-
// once resolved.
|
|
9492
|
+
__publicField(this, "tables", null);
|
|
9493
|
+
}
|
|
9494
|
+
// Open the tables lazily, not in the constructor: plugin providers are instantiated during the host's DI pass,
|
|
9495
|
+
// before the storage is served. The first query happens on an HTTP request, well after bootstrap.
|
|
9517
9496
|
get devices() {
|
|
9518
|
-
if (this.
|
|
9519
|
-
this.
|
|
9497
|
+
if (this.tables === null) {
|
|
9498
|
+
this.tables = this.context.storage.open(shellyStorage);
|
|
9520
9499
|
}
|
|
9521
|
-
return this.
|
|
9500
|
+
return this.tables.devices;
|
|
9522
9501
|
}
|
|
9523
|
-
list() {
|
|
9524
|
-
|
|
9502
|
+
async list() {
|
|
9503
|
+
const rows = await this.devices.find({
|
|
9504
|
+
orderBy: [
|
|
9505
|
+
{ field: "createdAt", direction: "asc" },
|
|
9506
|
+
{ field: "id", direction: "asc" }
|
|
9507
|
+
]
|
|
9508
|
+
});
|
|
9509
|
+
return rows;
|
|
9525
9510
|
}
|
|
9526
|
-
findById(id) {
|
|
9527
|
-
return this.devices.findOne({ where: { id } });
|
|
9511
|
+
async findById(id) {
|
|
9512
|
+
return await this.devices.findOne({ where: { id } });
|
|
9528
9513
|
}
|
|
9529
|
-
findByIp(ipAddress) {
|
|
9530
|
-
return this.devices.findOne({ where: { ipAddress } });
|
|
9514
|
+
async findByIp(ipAddress) {
|
|
9515
|
+
return await this.devices.findOne({ where: { ipAddress } });
|
|
9531
9516
|
}
|
|
9532
|
-
create(input) {
|
|
9517
|
+
async create(input) {
|
|
9533
9518
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
9534
|
-
const
|
|
9519
|
+
const row = await this.devices.insert({
|
|
9535
9520
|
name: input.name,
|
|
9536
9521
|
ipAddress: input.ipAddress,
|
|
9537
9522
|
generation: input.generation,
|
|
@@ -9542,26 +9527,26 @@ var DeviceRegistryService = class {
|
|
|
9542
9527
|
createdAt: now,
|
|
9543
9528
|
updatedAt: now
|
|
9544
9529
|
});
|
|
9545
|
-
return
|
|
9530
|
+
return row;
|
|
9546
9531
|
}
|
|
9547
9532
|
async updateProbe(id, patch) {
|
|
9548
|
-
await this.devices.update(
|
|
9549
|
-
|
|
9550
|
-
|
|
9551
|
-
|
|
9552
|
-
|
|
9553
|
-
|
|
9554
|
-
|
|
9555
|
-
|
|
9533
|
+
await this.devices.update(
|
|
9534
|
+
{ id },
|
|
9535
|
+
{
|
|
9536
|
+
generation: patch.generation,
|
|
9537
|
+
model: patch.model,
|
|
9538
|
+
authState: patch.authState,
|
|
9539
|
+
lastProbeAt: patch.lastProbeAt,
|
|
9540
|
+
lastProbeError: patch.lastProbeError,
|
|
9541
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
9542
|
+
}
|
|
9543
|
+
);
|
|
9556
9544
|
}
|
|
9557
9545
|
async updateAuthState(id, authState) {
|
|
9558
|
-
await this.devices.update(id, {
|
|
9559
|
-
authState,
|
|
9560
|
-
updatedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
9561
|
-
});
|
|
9546
|
+
await this.devices.update({ id }, { authState, updatedAt: (/* @__PURE__ */ new Date()).toISOString() });
|
|
9562
9547
|
}
|
|
9563
9548
|
async delete(id) {
|
|
9564
|
-
await this.devices.delete(id);
|
|
9549
|
+
await this.devices.delete({ id });
|
|
9565
9550
|
}
|
|
9566
9551
|
};
|
|
9567
9552
|
DeviceRegistryService = __decorateClass([
|
|
@@ -9793,7 +9778,7 @@ var ShellyProbeService = class {
|
|
|
9793
9778
|
json = await res.json();
|
|
9794
9779
|
} catch (err) {
|
|
9795
9780
|
const reason = err instanceof Error ? err.message : String(err);
|
|
9796
|
-
throw new Error(`probe of ${url} failed: ${reason}
|
|
9781
|
+
throw new Error(`probe of ${url} failed: ${reason}`, { cause: err });
|
|
9797
9782
|
}
|
|
9798
9783
|
return this.interpret(json);
|
|
9799
9784
|
}
|
|
@@ -9858,11 +9843,11 @@ var DiscoveryService = class {
|
|
|
9858
9843
|
return null;
|
|
9859
9844
|
}
|
|
9860
9845
|
})).filter((hit) => hit !== null);
|
|
9861
|
-
const
|
|
9846
|
+
const devices2 = [];
|
|
9862
9847
|
for (const hit of hits) {
|
|
9863
|
-
|
|
9848
|
+
devices2.push(await this.persist(hit.ipAddress, hit.source, hit.result));
|
|
9864
9849
|
}
|
|
9865
|
-
return { subnets, probed: candidates.length, devices };
|
|
9850
|
+
return { subnets, probed: candidates.length, devices: devices2 };
|
|
9866
9851
|
}
|
|
9867
9852
|
async persist(ipAddress, source, result) {
|
|
9868
9853
|
const probeFields = {
|
|
@@ -10277,9 +10262,9 @@ var ShellyController = class {
|
|
|
10277
10262
|
});
|
|
10278
10263
|
}
|
|
10279
10264
|
async firmwareOverview() {
|
|
10280
|
-
const
|
|
10265
|
+
const devices2 = await this.registry.list();
|
|
10281
10266
|
return Promise.all(
|
|
10282
|
-
|
|
10267
|
+
devices2.map(async (device) => {
|
|
10283
10268
|
if (device.generation === null) {
|
|
10284
10269
|
return { deviceId: device.id, status: null, error: "device generation is unknown; probe it first" };
|
|
10285
10270
|
}
|
|
@@ -10309,15 +10294,22 @@ var ShellyController = class {
|
|
|
10309
10294
|
}
|
|
10310
10295
|
const name = (body?.name ?? "").trim() || ipAddress;
|
|
10311
10296
|
const probed = await this.tryProbe(ipAddress);
|
|
10312
|
-
|
|
10313
|
-
|
|
10314
|
-
|
|
10315
|
-
|
|
10316
|
-
|
|
10317
|
-
|
|
10318
|
-
|
|
10319
|
-
|
|
10320
|
-
|
|
10297
|
+
try {
|
|
10298
|
+
return await this.registry.create({
|
|
10299
|
+
name,
|
|
10300
|
+
ipAddress,
|
|
10301
|
+
generation: probed.result?.generation ?? null,
|
|
10302
|
+
model: probed.result?.model ?? null,
|
|
10303
|
+
authState: probed.result?.authState ?? "unknown",
|
|
10304
|
+
lastProbeAt: probed.at,
|
|
10305
|
+
lastProbeError: probed.error
|
|
10306
|
+
});
|
|
10307
|
+
} catch (error) {
|
|
10308
|
+
if (error instanceof import_plugins_backend_sdk3.PluginStorageUniqueViolation) {
|
|
10309
|
+
throw new import_common8.ConflictException(`a device with IP ${ipAddress} already exists`);
|
|
10310
|
+
}
|
|
10311
|
+
throw error;
|
|
10312
|
+
}
|
|
10321
10313
|
}
|
|
10322
10314
|
list() {
|
|
10323
10315
|
return this.registry.list();
|
|
@@ -10429,9 +10421,8 @@ var PLUGIN_CONTEXT2 = /* @__PURE__ */ Symbol.for("attraccess.plugin.context");
|
|
|
10429
10421
|
var ShellyPluginModule = class {
|
|
10430
10422
|
};
|
|
10431
10423
|
var plugin = {
|
|
10432
|
-
//
|
|
10433
|
-
|
|
10434
|
-
entities: [ShellyDevice],
|
|
10424
|
+
// The host creates/adopts the declared tables at load time (gated on PLUGIN_STORAGE).
|
|
10425
|
+
storage: shellyStorage,
|
|
10435
10426
|
register(context) {
|
|
10436
10427
|
return {
|
|
10437
10428
|
module: ShellyPluginModule,
|