Pass current attribute values to vparam scripts
This commit is contained in:
1 parent
c43933225b
commit
5ab49014b0
1 file changed
+13
-2
+13
-2
@@ -1022,7 +1022,13 @@ generateGetVirtualParameterProvisions = (sessionContext, virtualParameterDeclara
|
|||||||
for declaration in virtualParameterDeclarations
|
for declaration in virtualParameterDeclarations
|
||||||
if declaration[1]
|
if declaration[1]
|
||||||
provisions ?= []
|
provisions ?= []
|
||||||
provisions.push([declaration[0][1], declaration[1], undefined])
|
currentTimestamps = {}
|
||||||
|
currentValues = {}
|
||||||
|
attrs = sessionContext.deviceData.attributes.get(declaration[0])
|
||||||
|
for k, v of attrs
|
||||||
|
currentTimestamps[k] = v[0]
|
||||||
|
currentValues[k] = v[1]
|
||||||
|
provisions.push([declaration[0][1], declaration[1], {}, currentTimestamps, currentValues])
|
||||||
delete declaration[1]
|
delete declaration[1]
|
||||||
|
|
||||||
return provisions
|
return provisions
|
||||||
@@ -1040,7 +1046,12 @@ generateSetVirtualParameterProvisions = (sessionContext, virtualParameterDeclara
|
|||||||
|
|
||||||
if val[0] != curVal[0] or val[1] != curVal[1]
|
if val[0] != curVal[0] or val[1] != curVal[1]
|
||||||
provisions ?= []
|
provisions ?= []
|
||||||
provisions.push([declaration[0][1], undefined, {value: val}])
|
currentTimestamps = {}
|
||||||
|
currentValues = {}
|
||||||
|
for k, v of attrs
|
||||||
|
currentTimestamps[k] = v[0]
|
||||||
|
currentValues[k] = v[1]
|
||||||
|
provisions.push([declaration[0][1], {}, {value: val}, currentTimestamps, currentValues])
|
||||||
|
|
||||||
return provisions
|
return provisions
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user