Fix repeating vparam execution
This issue only happens when a device doesn't maintain a single connection for the entire session.
This commit is contained in:
1 parent
75b10bb528
commit
68ea4887b1
1 file changed
+8
-3
+8
-3
@@ -1049,15 +1049,20 @@ generateGetVirtualParameterProvisions = (sessionContext, virtualParameterDeclara
|
|||||||
provisions = null
|
provisions = null
|
||||||
for declaration in virtualParameterDeclarations
|
for declaration in virtualParameterDeclarations
|
||||||
if declaration[1]
|
if declaration[1]
|
||||||
provisions ?= []
|
|
||||||
currentTimestamps = {}
|
currentTimestamps = {}
|
||||||
currentValues = {}
|
currentValues = {}
|
||||||
|
dec = {}
|
||||||
attrs = sessionContext.deviceData.attributes.get(declaration[0])
|
attrs = sessionContext.deviceData.attributes.get(declaration[0])
|
||||||
|
for k, v of declaration[1]
|
||||||
|
continue if k != 'value' and k != 'writable'
|
||||||
|
if not (v < attrs[k][0])
|
||||||
|
dec[k] = v
|
||||||
for k, v of attrs
|
for k, v of attrs
|
||||||
currentTimestamps[k] = v[0]
|
currentTimestamps[k] = v[0]
|
||||||
currentValues[k] = v[1]
|
currentValues[k] = v[1]
|
||||||
provisions.push([declaration[0][1], declaration[1], {}, currentTimestamps, currentValues])
|
if (Object.keys(dec).length)
|
||||||
delete declaration[1]
|
provisions ?= []
|
||||||
|
provisions.push([declaration[0][1], dec, {}, currentTimestamps, currentValues])
|
||||||
|
|
||||||
return provisions
|
return provisions
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user