Implicit fetch of 'writable' attribute
The writable attribute may not already be present when attempting to modify parameters included in the inform message. For other parameters the writable attrbiute is guarenteed to have already been fetched during discovery.
This commit is contained in:
1 parent
2e32b5d2a6
commit
bdad2f9a32
1 file changed
+21
-9
+21
-9
@@ -910,10 +910,15 @@ function runDeclarations(
|
|||||||
if (!unpacked)
|
if (!unpacked)
|
||||||
unpacked = device.unpack(sessionContext.deviceData, path);
|
unpacked = device.unpack(sessionContext.deviceData, path);
|
||||||
|
|
||||||
for (const u of unpacked)
|
for (const u of unpacked) {
|
||||||
mergeAttributeValues(u, declaration.attrSet, declaration.defer);
|
mergeAttributeValues(u, declaration.attrSet, declaration.defer);
|
||||||
|
// Ensure writable attr is available
|
||||||
|
mergeAttributeTimestamps(u, { writable: 1 });
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
mergeAttributeValues(path, declaration.attrSet, declaration.defer);
|
mergeAttributeValues(path, declaration.attrSet, declaration.defer);
|
||||||
|
// Ensure writable attr is available
|
||||||
|
mergeAttributeTimestamps(path, { writable: 1 });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -937,14 +942,15 @@ function runDeclarations(
|
|||||||
keys = {};
|
keys = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (!parent.wildcard && !parent.alias) {
|
||||||
((path.wildcard | path.alias) & ((1 << (path.length - 1)) - 1)) ===
|
|
||||||
0
|
|
||||||
) {
|
|
||||||
parent = sessionContext.deviceData.paths.add(parent);
|
parent = sessionContext.deviceData.paths.add(parent);
|
||||||
if (!unpacked)
|
if (!unpacked)
|
||||||
unpacked = device.unpack(sessionContext.deviceData, path);
|
unpacked = device.unpack(sessionContext.deviceData, path);
|
||||||
|
|
||||||
|
// Ensure writable attr is available
|
||||||
|
mergeAttributeTimestamps(parent, { writable: 1 });
|
||||||
|
for (const u of unpacked) mergeAttributeTimestamps(u, { writable: 1 });
|
||||||
|
|
||||||
processInstances(
|
processInstances(
|
||||||
sessionContext,
|
sessionContext,
|
||||||
parent,
|
parent,
|
||||||
@@ -960,13 +966,19 @@ function runDeclarations(
|
|||||||
parent
|
parent
|
||||||
);
|
);
|
||||||
for (const par of parentsUnpacked) {
|
for (const par of parentsUnpacked) {
|
||||||
|
const up = device.unpack(
|
||||||
|
sessionContext.deviceData,
|
||||||
|
par.concat(path.slice(-1))
|
||||||
|
);
|
||||||
|
|
||||||
|
// Ensure writable attr is available
|
||||||
|
mergeAttributeTimestamps(par, { writable: 1 });
|
||||||
|
for (const u of up) mergeAttributeTimestamps(u, { writable: 1 });
|
||||||
|
|
||||||
processInstances(
|
processInstances(
|
||||||
sessionContext,
|
sessionContext,
|
||||||
par,
|
par,
|
||||||
device.unpack(
|
up,
|
||||||
sessionContext.deviceData,
|
|
||||||
par.concat(path.slice(-1))
|
|
||||||
),
|
|
||||||
keys,
|
keys,
|
||||||
minInstances,
|
minInstances,
|
||||||
maxInstances,
|
maxInstances,
|
||||||
|
|||||||
Reference in new issue
Block a user