mirror of
https://github.com/mtan93/homebridge.git
synced 2026-03-08 05:31:55 +00:00
* No compilation step * Beginnings of web interface * Simple express server; React-based frontend * CommonJS style across codebase; auto-converts to RequireJS for browser * Using diffsync for realtime UI * "Provider" -> "Plugin" * Plugins expose one or more Providers
42 lines
911 B
JavaScript
42 lines
911 B
JavaScript
var request = require('basic-request');
|
|
var hap = require('HAP-NodeJS');
|
|
|
|
module.exports = {
|
|
providers: [LockitronProvider]
|
|
}
|
|
|
|
function LockitronProvider(log, config) {
|
|
this._log = log;
|
|
this._config = config;
|
|
}
|
|
|
|
LockitronProvider.title = "Lockitron";
|
|
|
|
LockitronProvider.config = {
|
|
accessToken: {
|
|
type: 'string',
|
|
description: "You can find your personal Access Token at: https://api.lockitron.com",
|
|
required: true
|
|
},
|
|
lockID: {
|
|
type: 'string',
|
|
description: "If specified, only the lock with this ID will be exposed as an accessory.",
|
|
}
|
|
}
|
|
|
|
LockitronProvider.prototype.validateConfig = function(callback) {
|
|
|
|
// validate the accessToken
|
|
var accessToken = this._config.accessToken;
|
|
|
|
// prove that we got a value
|
|
this._log.info('Access Token: ' + accessToken);
|
|
|
|
// all is well.
|
|
callback();
|
|
}
|
|
|
|
LockitronProvider.prototype.getAccessories = function(callback) {
|
|
|
|
}
|