Don't remove root Tags when empty
It unnecessarily complicates things.
This commit is contained in:
1 parent
0ca44d7ffb
commit
306193e6e9
2 files changed
+1
-7
No files matched your search
@@ -333,6 +333,7 @@ fetchDevice = (id, timestamp, patterns, callback) ->
|
|||||||
{object: [timestamp, 0], writable: [timestamp, 0], value: [timestamp, [v, 'xsd:string']]}])
|
{object: [timestamp, 0], writable: [timestamp, 0], value: [timestamp, [v, 'xsd:string']]}])
|
||||||
delete device[k]
|
delete device[k]
|
||||||
when '_tags'
|
when '_tags'
|
||||||
|
if v.length
|
||||||
res.push([['Tags'], timestamp,
|
res.push([['Tags'], timestamp,
|
||||||
{object: [timestamp, 1], writable: [timestamp, 0]}])
|
{object: [timestamp, 1], writable: [timestamp, 0]}])
|
||||||
for t in v
|
for t in v
|
||||||
|
|||||||
@@ -698,13 +698,6 @@ rpcRequest = (sessionContext, _declarations, callback) ->
|
|||||||
toClear = device.set(sessionContext.deviceData, p, timestamp, {object: [timestamp, false], writable: [timestamp, true], value: [timestamp, [true, 'xsd:boolean']]}, toClear)
|
toClear = device.set(sessionContext.deviceData, p, timestamp, {object: [timestamp, false], writable: [timestamp, true], value: [timestamp, [true, 'xsd:boolean']]}, toClear)
|
||||||
else if c? and not v
|
else if c? and not v
|
||||||
toClear = device.set(sessionContext.deviceData, p, timestamp, toClear)
|
toClear = device.set(sessionContext.deviceData, p, timestamp, toClear)
|
||||||
noMoreTags = true
|
|
||||||
for p in sessionContext.deviceData.paths.find(['Tags', '*'], false, true)
|
|
||||||
if sessionContext.deviceData.attributes.has(p)
|
|
||||||
noMoreTags = false
|
|
||||||
break
|
|
||||||
if noMoreTags
|
|
||||||
toClear = device.set(sessionContext.deviceData, ['Tags'], timestamp, null, toClear)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Downloads
|
# Downloads
|
||||||
|
|||||||
Reference in new issue
Block a user