mirror of
https://github.com/karl0ss/orvibo-b25-server-kex.git
synced 2025-05-01 21:13:41 +01:00
Enhance settings handling
This commit is contained in:
parent
3f4628220b
commit
8abb861cab
11
Orvibo.js
11
Orvibo.js
@ -11,13 +11,12 @@ let ORVIBO_KEY = Settings.ORVIBO_KEY;
|
||||
let LOG_PACKET = Settings.LOG_PACKET;
|
||||
let PLUG_INFO = Settings.plugInfo;
|
||||
|
||||
const Orvibo = function(userSettings) {
|
||||
const Orvibo = function(userSettings = {}) {
|
||||
// Allow user to pass in settings
|
||||
if (userSettings != null) {
|
||||
ORVIBO_KEY = userSettings.ORVIBO_KEY;
|
||||
LOG_PACKET = userSettings.LOG_PACKET;
|
||||
PLUG_INFO = userSettings.plugInfo;
|
||||
}
|
||||
if('ORVIBO_KEY' in userSettings) ORVIBO_KEY = userSettings.ORVIBO_KEY;
|
||||
if('plugInfo' in userSettings) PLUG_INFO = userSettings.plugInfo;
|
||||
if('PLUG_INFO' in userSettings) PLUG_INFO = userSettings.PLUG_INFO;
|
||||
if('LOG_PACKET' in userSettings) LOG_PACKET = userSettings.LOG_PACKET;
|
||||
|
||||
if (ORVIBO_KEY === '') {
|
||||
logger.log('Please pass Orvibo PK key details via the constructor or add to OrviboSettings.js file. See Readme');
|
||||
|
Loading…
x
Reference in New Issue
Block a user