Fixed bug in getting the configured parameter type. Fixed bug in processing object presets.

This commit is contained in:
Zaid Abdulla committed 2013-12-07 01:18:25 +03:00
1 parent 6f0d7a747e
commit 1fe72e93a9
2 files changed
+3 -3

No files matched your search

+2 -2
View File
@@ -200,7 +200,7 @@ exports.processDevicePreset = (deviceId, devicePreset, callback) ->
for objectName, objectDetails of object
continue if not objectDetails.current?
if objectDetails.preset?
if Object.keys(objectDetails.current) > 0
if Object.keys(objectDetails.current).length > 0
for i, obj of objectDetails.current
for paramName, paramValue of objectDetails.preset
continue if paramName[0] == '_'
@@ -214,7 +214,7 @@ exports.processDevicePreset = (deviceId, devicePreset, callback) ->
for k,v of objectDetails.preset
vals.push([k, v]) if k[0] != '_'
taskList.push({device : deviceId, name : 'addObject', objectName : parameterPath, parameterValues : vals, instanceName : objectName})
else if Object.keys(objectDetails.current) > 0
else if Object.keys(objectDetails.current).length > 0
for i, obj of objectDetails.current
taskList.push({device : deviceId, name : 'deleteObject', objectName : "#{parameterPath}.#{i}"})