hueadm
Version:
A command line management interface to phillips hue
38 lines (29 loc) • 707 B
JavaScript
var common = require('../common');
module.exports = sensor;
function sensor(subcmd, opts, args, cb) {
var self = this;
var finish = common.makeFinisher(opts, cb);
if (opts.help) {
self.do_help('help', {}, [subcmd], cb);
return;
}
var id = parseInt(args.shift(), 10);
if (isNaN(id)) {
cb(new Error('`id` argument must be a number'));
return;
}
self.client.sensor(id, finish);
}
sensor.options = [
{
names: ['help', 'h'],
type: 'bool',
help: 'Show this help.'
},
{
names: ['json', 'j'],
type: 'bool',
help: 'JSON output.'
}
];
sensor.help = 'Show a sensor\n\n{{options}}';