mirror of
https://github.com/koush/scrypted.git
synced 2026-02-10 09:12:03 +00:00
server: auto populate plugin info
This commit is contained in:
4
server/package-lock.json
generated
4
server/package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "@scrypted/server",
|
||||
"version": "0.0.148",
|
||||
"version": "0.0.149",
|
||||
"lockfileVersion": 2,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@scrypted/server",
|
||||
"version": "0.0.148",
|
||||
"version": "0.0.149",
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"@mapbox/node-pre-gyp": "^1.0.8",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@scrypted/server",
|
||||
"version": "0.0.148",
|
||||
"version": "0.0.149",
|
||||
"description": "",
|
||||
"dependencies": {
|
||||
"@mapbox/node-pre-gyp": "^1.0.8",
|
||||
|
||||
@@ -479,7 +479,12 @@ export class ScryptedRuntime extends PluginHttp<HttpPluginData> {
|
||||
}
|
||||
|
||||
async installPlugin(plugin: Plugin, pluginDebug?: PluginDebug): Promise<PluginHost> {
|
||||
const device: Device = Object.assign({}, plugin.packageJson.scrypted);
|
||||
const device: Device = Object.assign({}, plugin.packageJson.scrypted, {
|
||||
info: {
|
||||
manufacturer: plugin.packageJson.name,
|
||||
version: plugin.packageJson.version,
|
||||
}
|
||||
} as Device);
|
||||
try {
|
||||
if (!device.interfaces.includes(ScryptedInterface.Readme)) {
|
||||
const zipData = Buffer.from(plugin.zip, 'base64');
|
||||
@@ -743,6 +748,13 @@ export class ScryptedRuntime extends PluginHttp<HttpPluginData> {
|
||||
|
||||
for await (const plugin of this.datastore.getAll(Plugin)) {
|
||||
try {
|
||||
const pluginDevice = this.findPluginDevice(plugin._id);
|
||||
setState(pluginDevice, ScryptedInterfaceProperty.info, {
|
||||
info: {
|
||||
manufacturer: plugin.packageJson.name,
|
||||
version: plugin.packageJson.version,
|
||||
}
|
||||
} as Device);
|
||||
this.runPlugin(plugin);
|
||||
}
|
||||
catch (e) {
|
||||
|
||||
Reference in New Issue
Block a user