Skip to content

Commit 69d5082

Browse files
committed
Added valueType to alarm.
1 parent 0199c61 commit 69d5082

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

apple/resources/alarms.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ var MongoStore = require("../../../jsonapi-store-mongodb");
33
//var rppHandler = require("../handlers/rppHandler.js");
44
const REGEX_LEVEL = /(^Critical$)|(^Info$)|(^Warning$)$/gi;
55
const REGEX_ALARM_TYPE = /(^HH$)|(^HI$)|(^LO$)|(^LL$)|(^INVALID$)$/gi;
6+
const REGEX_VALUE_TYPE = /(^bool$)|(^real$)|(^integer$)|(^string$)$/gi;
67

78
jsonApi.define({
89
namespace: "json:api",
@@ -41,6 +42,10 @@ jsonApi.define({
4142
value: jsonApi.Joi.any().optional()
4243
.description("The current value from the tag in engineering units.")
4344
.example("24.5"),
45+
valueType: jsonApi.Joi.string().trim().regex(REGEX_VALUE_TYPE)
46+
.default('real')
47+
.description('Can only be bool, real, integer or string.')
48+
.example('bool'),
4449
units: jsonApi.Joi.string().optional()
4550
.description("The tag units.")
4651
.example("Volts"),

0 commit comments

Comments
 (0)