Do not store available custom commands in device doc, find them from config. No longer having to reinitialize the device after adding a custom command.

This commit is contained in:
Zaid Abdulla committed 2013-09-13 13:02:44 +03:00
1 parent 86ff19a6e2
commit 9537bfad0f
4 files changed
+26 -14

No files matched your search

-1
View File
@@ -107,7 +107,6 @@ updateDevice = (currentRequest, actions, callback) ->
commandName = p[0]
updates["_customCommands.#{commandName}._value"] = p[1]
updates["_customCommands.#{commandName}._timestamp"] = now
updates["_customCommands.#{commandName}._commands"] = p[2] if p[2]?
if Object.keys(updates).length > 0 or Object.keys(deletes).length > 0
db.devicesCollection.update({'_id' : currentRequest.deviceId}, {'$set' : updates, '$unset' : deletes}, {}, (err, count) ->