🗀 PLUGINS
C_PLUGINS extends COMMON_COMPONENT
Component to manage/update plugins that extend the functionlity of OpenHaus
- Schema
- Methods
- Classes
- class.plugin.js Represents a plugin instance
| Name | Type | Required | Default value | Description |
|---|---|---|---|---|
| _id | String | ObjectId | MongoDB ObjectID converted to a String | |
| name | String | x | Human friendly name e.g. "Smasung Smart TV", "Pioneer AV Receiver" | |
| uuid | String | uuid v4 | UUIDv4, which is used as filename | |
| timestamps | Object | Timestamps, when something was done to the object e.g. created/updated |
||
| timestamps.created | Number | Date.now() |
Unix timestamp, set when .add is called to Date.now() |
|
| timestamps.updated | Number | null |
Unix timestamp, set to Date.now() when .update is called |
|
| autostart | Boolean | true |
Autostart/boot the plugin automaticly on start | |
| enabled | Boolean | true |
Indicates if user accounts can be used to login/is enabled for use |
{
"_id":"60ede907953fe23d3c585852",
"name":"ZigBee Gateway (DeCONz)",
"uuid":"d11e7f38-91cb-4f32-89e8-3452f624bb47",
"timestamps":{
"created":1628451824939,
"updated":null
},
"enabled":true,
"autostart":true
}data{Object} Object structure as defined in schema.cb{Function} Callback function, if absent, a promise is returned.
Add a new plugin to the database and creates a plugin instance
id{String} plugin id as defined in schema.cb{Function} Callback function, if absent, a promise is returned.
Get a plugin from the
.itemsarray
id{String} plugin id as defined in schema.cb{Function} Callback function, if absent, a promise is returned.
Removes a plugin from the database
id{String} plugin id as defined in schema.data{Object} Properties to update on pluginidobject/instance.cb{Function} Callback function, if absent, a promise is returned.
Updates a plugin object in database & plugin instance in
.itemsarray
obj{Object} Key/value to look for plugins.cb{Function} Callback function, if absent, a promise is returned.
Find plugin with mathing key/values pair in the
.itemsarray
Represent a plugin instance