Provider config and cli-based setup

This commit is contained in:
Nick Farina
2015-07-15 22:36:45 -07:00
parent 6afff4f3e4
commit 5611e38beb
13 changed files with 233 additions and 137 deletions

View File

@@ -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}`);
}
}

View File

@@ -8,5 +8,8 @@
},
"keywords": [
"homebridge-provider"
]
}
],
"dependencies": {
"request": "^2.58.0"
}
}