@scrypted/server 0.0.107 → 0.0.108

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.

Files changed (38) hide show
  1. package/dist/http-interfaces.js +2 -2
  2. package/dist/http-interfaces.js.map +1 -1
  3. package/dist/plugin/listen-zero.js +13 -1
  4. package/dist/plugin/listen-zero.js.map +1 -1
  5. package/dist/plugin/plugin-host-api.js +2 -2
  6. package/dist/plugin/plugin-host-api.js.map +1 -1
  7. package/dist/plugin/plugin-host.js +36 -87
  8. package/dist/plugin/plugin-host.js.map +1 -1
  9. package/dist/plugin/plugin-http.js +100 -0
  10. package/dist/plugin/plugin-http.js.map +1 -0
  11. package/dist/plugin/plugin-lazy-remote.js +73 -0
  12. package/dist/plugin/plugin-lazy-remote.js.map +1 -0
  13. package/dist/plugin/plugin-remote-websocket.js +40 -34
  14. package/dist/plugin/plugin-remote-websocket.js.map +1 -1
  15. package/dist/plugin/plugin-remote.js +35 -26
  16. package/dist/plugin/plugin-remote.js.map +1 -1
  17. package/dist/runtime.js +45 -111
  18. package/dist/runtime.js.map +1 -1
  19. package/dist/scrypted-main.js +3 -0
  20. package/dist/scrypted-main.js.map +1 -1
  21. package/dist/services/plugin.js +2 -2
  22. package/dist/services/plugin.js.map +1 -1
  23. package/dist/state.js +2 -8
  24. package/dist/state.js.map +1 -1
  25. package/package.json +2 -2
  26. package/src/http-interfaces.ts +3 -3
  27. package/src/plugin/listen-zero.ts +13 -0
  28. package/src/plugin/plugin-api.ts +1 -1
  29. package/src/plugin/plugin-host-api.ts +2 -3
  30. package/src/plugin/plugin-host.ts +40 -95
  31. package/src/plugin/plugin-http.ts +117 -0
  32. package/src/plugin/plugin-lazy-remote.ts +70 -0
  33. package/src/plugin/plugin-remote-websocket.ts +55 -60
  34. package/src/plugin/plugin-remote.ts +45 -38
  35. package/src/runtime.ts +55 -128
  36. package/src/scrypted-main.ts +4 -0
  37. package/src/services/plugin.ts +2 -2
  38. package/src/state.ts +2 -10
package/src/state.ts CHANGED
@@ -72,23 +72,15 @@ export class ScryptedStateManager extends EventRegistry {
72
72
  }
73
73
 
74
74
  updateDescriptor(device: PluginDevice) {
75
- for (const plugin of Object.values(this.scrypted.plugins)) {
76
- plugin.remote?.updateDeviceState(device._id, device.state);
77
- }
75
+ this.notify(device._id, undefined, ScryptedInterface.ScryptedDevice, undefined, device.state, true);
78
76
  }
79
77
 
80
78
  removeDevice(id: string) {
81
- for (const plugin of Object.values(this.scrypted.plugins)) {
82
- plugin.remote?.updateDeviceState(id, undefined);
83
- }
84
-
85
79
  this.notify(undefined, undefined, ScryptedInterface.ScryptedDevice, ScryptedInterfaceProperty.id, id, true);
86
80
  }
87
81
 
88
82
  notifyInterfaceEvent(device: PluginDevice, eventInterface: ScryptedInterface | string, value: any) {
89
- const eventTime = Date.now();
90
-
91
- this.notify(device?._id, eventTime, eventInterface, undefined, value, true);
83
+ this.notify(device?._id, Date.now(), eventInterface, undefined, value, true);
92
84
  }
93
85
 
94
86
  setState(id: string, property: string, value: any) {