Fixed bug where ordering of key parameters in object definition may affect preset behavior.

This commit is contained in:
Zaid Abdulla committed 2015-07-03 01:42:49 +03:00
1 parent a02e3ecf17
commit 28c5dc0d46
1 file changed
+13 -5
+13 -5
View File
@@ -294,11 +294,19 @@ exports.processDevicePreset = (deviceId, devicePreset, callback) ->
getObjectHash = (object) -> getObjectHash = (object) ->
return object._id if not object._keys? or object._keys.length == 0 if object._keys?.length
hash = '' keys = object._keys
for k in object._keys else
hash += "#{k}=#{object[k]}" keys = (k for k in Object.keys(object) when k[0] != '_')
return hash
keys.sort()
hash = []
for k in keys
hash.push(k)
hash.push(common.getParamValueFromPath(object, k))
return JSON.stringify(hash)
accumulateConfigurations = (presets, objects) -> accumulateConfigurations = (presets, objects) ->