Skip to content

Commit

Permalink
feat: custom plugins loader (#478)
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando authored Feb 6, 2021
1 parent 56e1c62 commit 020f82b
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/ZwaveClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,15 @@ function ZwaveClient (config, socket) {
this.healTimeout = null

this.status = ZWAVE_STATUS.closed

// load custom plugins
if (config.plugin) {
try {
require(config.plugin)(this)
} catch (error) {
logger.error(`Error while loading ${config.plugin} plugin`, error.message)
}
}
}

inherits(ZwaveClient, EventEmitter)
Expand Down

0 comments on commit 020f82b

Please sign in to comment.