Implement device:identify command

This commit is contained in:
Juan Cruz Viotti 2014-11-21 14:21:47 -04:00
parent 982c18a900
commit f56cd8162c
2 changed files with 10 additions and 0 deletions

View File

@ -2,6 +2,7 @@ deviceModel = require('../models/device')
getDeviceDisplayName = require('../device/device').getDisplayName
log = require('../log/log')
table = require('../table/table')
server = require('../server/server')
widgets = require('../widgets/widgets')
patterns = require('../patterns/patterns')
authHooks = require('../hooks/auth')
@ -29,3 +30,7 @@ exports.remove = authHooks.failIfNotLoggedIn (id, program) ->
.catch(callback)
, (error) ->
throw error if error?
exports.identify = authHooks.failIfNotLoggedIn (uuid) ->
server.post '/blink', { uuid }, (error) ->
throw error if error?

View File

@ -64,6 +64,11 @@ program
.description('Remove a device')
.action(device.remove)
program
.command('device:identify <uuid>')
.description('Identify a device with a UUID')
.action(device.identify)
# ---------- Preferences Module ----------
preferences = require('./actions/preferences')