Files
homebridge/example-providers/homebridge-lockitron/index.js
2015-07-16 13:09:01 -07:00

31 lines
747 B
JavaScript

import request from 'request';
// Create a logger for our provider
let log = homebridge.logger('homebridge-lockitron');
// Demonstrate that we were loaded - run homebridge with the "-D" option to see this message
log.debug("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
log.info(`Access Token: ${accessToken}`);
// all is well.
callback();
}
}