@scrypted/server 0.0.170 → 0.0.171
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.
Potentially problematic release.
This version of @scrypted/server might be problematic. Click here for more details.
@@ -11,8 +11,12 @@ function checkProperty(key, value) {
|
|
11
11
|
if (key === types_1.ScryptedInterfaceProperty.interfaces)
|
12
12
|
throw new Error("interfaces is a read only post-mixin computed property, use providedInterfaces");
|
13
13
|
const iface = descriptor_1.propertyInterfaces[key.toString()];
|
14
|
-
if (iface === types_1.ScryptedInterface.ScryptedDevice)
|
15
|
-
|
14
|
+
if (iface === types_1.ScryptedInterface.ScryptedDevice) {
|
15
|
+
// only allow info to be set, since that doesn't actually change the descriptor
|
16
|
+
// or the provided* properties (room, interfaces, name, type).
|
17
|
+
if (key !== types_1.ScryptedInterfaceProperty.info)
|
18
|
+
throw new Error(`${key.toString()} can not be set. Use DeviceManager.onDevicesChanges or DeviceManager.onDeviceDiscovered to update the device description.`);
|
19
|
+
}
|
16
20
|
}
|
17
21
|
exports.checkProperty = checkProperty;
|
18
22
|
//# sourceMappingURL=plugin-state-check.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"plugin-state-check.js","sourceRoot":"","sources":["../../src/plugin/plugin-state-check.ts"],"names":[],"mappings":";;;AAAA,2CAA+E;AAC/E,6CAAkD;AAElD,SAAgB,aAAa,CAAC,GAAW,EAAE,KAAU;IACjD,IAAI,GAAG,KAAK,iCAAyB,CAAC,EAAE;QACpC,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACvC,IAAI,GAAG,KAAK,iCAAyB,CAAC,MAAM;QACxC,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;IAC3C,IAAI,GAAG,KAAK,iCAAyB,CAAC,UAAU;QAC5C,MAAM,IAAI,KAAK,CAAC,gFAAgF,CAAC,CAAC;IACtG,MAAM,KAAK,GAAG,+BAAkB,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;IACjD,IAAI,KAAK,KAAK,yBAAiB,CAAC,cAAc;
|
1
|
+
{"version":3,"file":"plugin-state-check.js","sourceRoot":"","sources":["../../src/plugin/plugin-state-check.ts"],"names":[],"mappings":";;;AAAA,2CAA+E;AAC/E,6CAAkD;AAElD,SAAgB,aAAa,CAAC,GAAW,EAAE,KAAU;IACjD,IAAI,GAAG,KAAK,iCAAyB,CAAC,EAAE;QACpC,MAAM,IAAI,KAAK,CAAC,iBAAiB,CAAC,CAAC;IACvC,IAAI,GAAG,KAAK,iCAAyB,CAAC,MAAM;QACxC,MAAM,IAAI,KAAK,CAAC,qBAAqB,CAAC,CAAC;IAC3C,IAAI,GAAG,KAAK,iCAAyB,CAAC,UAAU;QAC5C,MAAM,IAAI,KAAK,CAAC,gFAAgF,CAAC,CAAC;IACtG,MAAM,KAAK,GAAG,+BAAkB,CAAC,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;IACjD,IAAI,KAAK,KAAK,yBAAiB,CAAC,cAAc,EAAE;QAC5C,+EAA+E;QAC/E,8DAA8D;QAC9D,IAAI,GAAG,KAAK,iCAAyB,CAAC,IAAI;YACtC,MAAM,IAAI,KAAK,CAAC,GAAG,GAAG,CAAC,QAAQ,EAAE,2HAA2H,CAAC,CAAC;KACrK;AACL,CAAC;AAdD,sCAcC"}
|
package/package.json
CHANGED
@@ -9,6 +9,10 @@ export function checkProperty(key: string, value: any) {
|
|
9
9
|
if (key === ScryptedInterfaceProperty.interfaces)
|
10
10
|
throw new Error("interfaces is a read only post-mixin computed property, use providedInterfaces");
|
11
11
|
const iface = propertyInterfaces[key.toString()];
|
12
|
-
if (iface === ScryptedInterface.ScryptedDevice)
|
13
|
-
|
12
|
+
if (iface === ScryptedInterface.ScryptedDevice) {
|
13
|
+
// only allow info to be set, since that doesn't actually change the descriptor
|
14
|
+
// or the provided* properties (room, interfaces, name, type).
|
15
|
+
if (key !== ScryptedInterfaceProperty.info)
|
16
|
+
throw new Error(`${key.toString()} can not be set. Use DeviceManager.onDevicesChanges or DeviceManager.onDeviceDiscovered to update the device description.`);
|
17
|
+
}
|
14
18
|
}
|