Closed MichaelKohler closed 3 years ago
Approved too quickly. manifest.id
is actually coming directly from manifest.json
.
The code you were looking at is the legacy interface that we shouldn't be using anymore. I've been unable to take it out, though, for technical reasons.
Should have added this info initially, I'm getting an error in my adapters when using manifest.id
.
2020-12-03 14:33:19.874 ERROR : Invalid message received: {
"messageType": 4096,
"data": {
"adapterId": "NeeoAdapter",
"name": "NeeoAdapter",
"pluginId": "neeo-adapter"
}
}
In 1.0.0 there is a second error going with that:
2020-12-04 10:13:19.757 ERROR : Invalid message received: {
"messageType": 4096,
"data": {
"adapterId": "NeeoAdapter",
"name": "NeeoAdapter",
"pluginId": "neeo-adapter"
}
}
2020-12-04 10:13:19.758 ERROR : Validation error: [
{
"keyword": "required",
"dataPath": ".data",
"schemaPath": "#/properties/data/required",
"params": {
"missingProperty": "packageName"
},
"message": "should have required property 'packageName'"
}
]
Here's the second parameter logged inside the constructor:
{
name: 'neeo-adapter',
display_name: 'NEEO Adapter',
moziot: {
exec: '{nodeLoader} {path}',
schema: { type: 'object', required: [], properties: [Object] },
config: { neeoIP: '192.168.0.229', devices: [Array] }
}
}
When using manifest.name
this error goes away.
The key is to make sure you're using const manifest = require('./manifest.json')
(or similar path), rather than using the manifest
variable that's passed in from the add-on loader.
Oh no, now I get it. Should have looked closer, then I would have seen that it's not actually using that param but rather the require above. Sorry!
The
id
property doesn't exist anymore,name
is now pointing to the ID: https://github.com/WebThingsIO/gateway/blob/819b8cd4151ace303a6d2564fd70ef5d8cf5a0a3/src/addon-loader.js#L53