@halsystems/red-bacnet 1.0.21 → 1.0.23
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/CHANGELOG.md +8 -0
- package/common/job/discover_point.js +11 -2
- package/common/job/read_point.js +1 -1
- package/common/schema.js +4 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -35,10 +35,14 @@ const multiStateObjectTypes = [
|
|
|
35
35
|
baEnum.ObjectType.MULTI_STATE_OUTPUT,
|
|
36
36
|
baEnum.ObjectType.MULTI_STATE_VALUE
|
|
37
37
|
]
|
|
38
|
+
// const scheduleObjectTypes = [
|
|
39
|
+
// baEnum.ObjectType.SCHEDULE,
|
|
40
|
+
// ];
|
|
38
41
|
const supportedObjectTypes = [
|
|
39
42
|
...analogObjectTypes,
|
|
40
43
|
...binaryObjectTypes,
|
|
41
|
-
...multiStateObjectTypes
|
|
44
|
+
...multiStateObjectTypes,
|
|
45
|
+
// ...scheduleObjectTypes
|
|
42
46
|
]
|
|
43
47
|
|
|
44
48
|
// ---------------------------------- export ----------------------------------
|
|
@@ -246,7 +250,12 @@ const readPoints = async (
|
|
|
246
250
|
{ id: baEnum.PropertyIdentifier.INACTIVE_TEXT },
|
|
247
251
|
{ id: baEnum.PropertyIdentifier.ACTIVE_TEXT }
|
|
248
252
|
] : []),
|
|
249
|
-
...(multiStateObjectTypes.includes(obj.value.type) ? [{ id: baEnum.PropertyIdentifier.STATE_TEXT }] : [])
|
|
253
|
+
...(multiStateObjectTypes.includes(obj.value.type) ? [{ id: baEnum.PropertyIdentifier.STATE_TEXT }] : []),
|
|
254
|
+
// ...(scheduleObjectTypes.includes(obj.value.type) ? [
|
|
255
|
+
// { id: baEnum.PropertyIdentifier.WEEKLY_SCHEDULE },
|
|
256
|
+
// { id: baEnum.PropertyIdentifier.EXCEPTION_SCHEDULE },
|
|
257
|
+
// { id: baEnum.PropertyIdentifier.SCHEDULE_DEFAULT }
|
|
258
|
+
// ] : [])
|
|
250
259
|
]
|
|
251
260
|
}));
|
|
252
261
|
|
package/common/job/read_point.js
CHANGED
|
@@ -247,7 +247,6 @@ module.exports = {
|
|
|
247
247
|
|
|
248
248
|
// format point
|
|
249
249
|
const facetObj = facetsStrToObj(p.facets);
|
|
250
|
-
|
|
251
250
|
if (facetObj.trueText != null || facetObj.falseText != null) { // boolean
|
|
252
251
|
fvalue = fvalue ? facetObj.trueText : facetObj.falseText
|
|
253
252
|
} else if (facetObj.range != null) { // enum
|
|
@@ -256,6 +255,7 @@ module.exports = {
|
|
|
256
255
|
else
|
|
257
256
|
fvalue = String(fvalue)
|
|
258
257
|
} else { // general
|
|
258
|
+
// handle number
|
|
259
259
|
if (typeof value === 'number') {
|
|
260
260
|
value = (facetObj.precision != null) ? +value.toFixed(facetObj.precision) : +value.toFixed(1)
|
|
261
261
|
fvalue = value
|
package/common/schema.js
CHANGED
|
@@ -48,7 +48,10 @@ module.exports = {
|
|
|
48
48
|
}),
|
|
49
49
|
|
|
50
50
|
readPointSchema: Joi.object({
|
|
51
|
-
value: Joi.
|
|
51
|
+
value: Joi.alternatives().try(
|
|
52
|
+
Joi.number(),
|
|
53
|
+
Joi.string()
|
|
54
|
+
).required(),
|
|
52
55
|
fvalue: Joi.string().allow('').required(),
|
|
53
56
|
err: Joi.string().allow(''),
|
|
54
57
|
}),
|