@halsystems/red-bacnet 1.0.18 → 1.0.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/common/job/read_point.js +7 -1
- package/package.json +1 -1
package/common/job/read_point.js
CHANGED
|
@@ -207,7 +207,9 @@ module.exports = {
|
|
|
207
207
|
|
|
208
208
|
if (Array.isArray(data.result))
|
|
209
209
|
data.result.forEach(i => {
|
|
210
|
-
|
|
210
|
+
i.values.forEach(v => {
|
|
211
|
+
points[`${data.id}_${i.objectId.type}_${i.objectId.instance}_${v.id}`] = v.value?.[0]?.value;
|
|
212
|
+
});
|
|
211
213
|
});
|
|
212
214
|
|
|
213
215
|
count++;
|
|
@@ -232,6 +234,10 @@ module.exports = {
|
|
|
232
234
|
let value = points[key];
|
|
233
235
|
let err = null
|
|
234
236
|
|
|
237
|
+
// process
|
|
238
|
+
if (typeof value === 'boolean')
|
|
239
|
+
value = value ? 1 : 0
|
|
240
|
+
|
|
235
241
|
if (value == null || value?.errorClass != null || value?.errorCode != null) {
|
|
236
242
|
value = 0
|
|
237
243
|
err = ERR_READING_POINT
|