mirror of
https://github.com/mtan93/homebridge.git
synced 2026-03-20 21:03:27 +00:00
Provider config and cli-based setup
This commit is contained in:
@@ -1,3 +1,24 @@
|
||||
import request from 'request';
|
||||
|
||||
// Demonstrate that we were loaded
|
||||
console.log("Lockitron provider loaded!");
|
||||
|
||||
module.exports = {
|
||||
|
||||
config: {
|
||||
accessToken: {
|
||||
type: 'string',
|
||||
description: "You can find your personal Access Token at: https://api.lockitron.com",
|
||||
required: true
|
||||
}
|
||||
},
|
||||
|
||||
validateConfig: function(callback) {
|
||||
|
||||
// validate the accessToken
|
||||
let accessToken = homebridge.config.get('homebridge-lockitron.accessToken');
|
||||
|
||||
// prove that we got a value
|
||||
console.log(`Access Token: ${accessToken}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,5 +8,8 @@
|
||||
},
|
||||
"keywords": [
|
||||
"homebridge-provider"
|
||||
]
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"request": "^2.58.0"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user