Match the existing parameter type when applying configuration

This commit is contained in:
Zaid Abdulla committed 2013-01-14 16:17:50 +03:00
1 parent c568bb6332
commit 5c834568ab
2 files changed
+32 -9

No files matched your search

+4 -2
View File
@@ -72,8 +72,10 @@ exports.assertPresets = (deviceId, presetsHash, callback) ->
for c in configurations
switch c.type
when 'value'
if c.value != common.getParamValueFromPath(device, "#{c.name}._value")
setParameterValues.push([c.name, c.value])
src = common.getParamValueFromPath(device, "#{c.name}._value")
dst = common.matchType(src, c.value)
if src != dst
setParameterValues.push([c.name, dst])
when 'age'
timeDiff = (now - common.getParamValueFromPath(device, "#{c.name}._timestamp")) / 1000
if (c.age - timeDiff < config.PRESETS_TIME_PADDING)