forked from hobbyquaker/homekit2mqtt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.js
37 lines (36 loc) · 1.19 KB
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
var pkg = require('./package.json');
var config = require('yargs')
.usage(pkg.name + ' ' + pkg.version + '\n' + pkg.description + '\n\nUsage: $0 [options]')
.describe('v', 'possible values: "error", "warn", "info", "debug"')
.describe('m', 'JSON file containing HomeKit Services to MQTT mapping definitions. See Readme.')
.describe('n', 'instance name. used as mqtt client id and as prefix for connected topic')
.describe('u', 'mqtt broker url. See https://github.com/mqttjs/MQTT.js#connect-using-a-url')
.describe('s', 'directory to store homekit data')
.describe('h', 'show help')
.alias({
'h': 'help',
'n': 'name',
'm': 'mapfile',
'u': 'url',
'v': 'verbosity',
'c': 'pincode',
'a': 'username',
'b': 'bridgename',
'p': 'port',
's': 'storagedir'
})
.default({
'c': '031-45-154',
'u': 'mqtt://127.0.0.1',
'n': 'homekit',
'm': __dirname + '/example-homekit2mqtt.json',
'v': 'info',
'a': 'CC:22:3D:E3:CE:F6',
'b': 'MQTT Bridge',
'p': 51826
})
//.config('config')
.version()
.help('help')
.argv;
module.exports = config;