@jotiotech/node-red-sia-premise-device 0.1.0

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/README.md ADDED
@@ -0,0 +1,4 @@
1
+ # SIA Device
2
+
3
+ TODO
4
+
@@ -0,0 +1,37 @@
1
+ <script type="text/javascript">
2
+ RED.nodes.registerType('SIA-device', {
3
+ category: 'common',
4
+ color: '#0B99D8',
5
+ defaults: {
6
+ name: { value: "" },
7
+ server: { value: "", type: "SIA-server", required: true }, // This will
8
+ },
9
+ align: 'left',
10
+ icon: "icon.png",
11
+ inputs: 1,
12
+ outputs: 0,
13
+ label: function () {
14
+ return this.name || "SIA Device";
15
+ },
16
+
17
+ });
18
+
19
+ </script>
20
+
21
+ <style>
22
+
23
+ .input-button-wrap>input {
24
+ width: 100% !important;
25
+ }
26
+ </style>
27
+
28
+ <script type="text/x-red" data-template-name="BJ-parser">
29
+ <div class="form-row">
30
+ <label for="node-input-name"><i class="icon-tag"></i> Name</label>
31
+ <input type="text" id="node-input-name" placeholder="Name">
32
+ </div>
33
+ <div class="form-row">
34
+ <label for="node-input-server">SIA Server</label>
35
+ <input type="text" id="node-input-server" placeholder="Select SIA Server">
36
+ </div>
37
+ </script>
package/SIA_device.js ADDED
@@ -0,0 +1,43 @@
1
+ const clientModule = __importDefault(require('./src/SIA_device.js'));
2
+
3
+
4
+ module.exports = function (RED) {
5
+
6
+
7
+ function ParserNode(config) {
8
+ RED.nodes.createNode(this, config);
9
+
10
+ this.serverConfig = RED.nodes.getNode(config.server);
11
+ const siaModule = new clientModule.default(serverConfig);
12
+ siaModule.connect();
13
+
14
+ this.on('input', message => {
15
+ parsedPayload = message.payload;
16
+
17
+
18
+ // const parser = new parserModule.default(message.statusSchema, parserConfig);
19
+ // message.payload.outJson = parser.processPayload(parsedPayload);
20
+
21
+
22
+ if(parsedPayload === undefined){
23
+ this.send(message);
24
+ return;
25
+ }
26
+ if(message.payload.parsingError == true){
27
+ this.send(message);
28
+ return;
29
+ }
30
+
31
+ this.send(message);
32
+ });
33
+ }
34
+
35
+ RED.nodes.registerType('SIA-device', ParserNode);
36
+ RED.nodes.registerType('SIA-server', require('./sia-server.js'));
37
+
38
+
39
+ };
40
+
41
+
42
+
43
+
@@ -0,0 +1,47 @@
1
+ <script type="text/javascript">
2
+ RED.nodes.registerType('SIA-server', {
3
+ category: 'config',
4
+ defaults: {
5
+ name: { value: "" },
6
+ receiverIP: { value: "", required: true },
7
+ receiverPort: { value: "", required: true },
8
+ siaAccount: { value: "", required: true },
9
+ siaPassword: { value: "", required: true },
10
+ encryptionEnabled: { value: false },
11
+ passwordInHex: { value: false },
12
+ },
13
+ label: function () {
14
+ return this.name || "SIA Server";
15
+ },
16
+ });
17
+ </script>
18
+ <script type="text/x-red" data-template-name="SIA-server">
19
+ <div class="form-row">
20
+ <label for="node-config-input-name"><i class="icon-tag"></i> Name</label>
21
+ <input type="text" id="node-config-input-name" placeholder="Name">
22
+ </div>
23
+ <div class="form-row">
24
+ <label for="node-config-input-receiverIP">Receiver IP</label>
25
+ <input type="text" id="node-config-input-receiverIP" placeholder="Receiver IP">
26
+ </div>
27
+ <div class="form-row">
28
+ <label for="node-config-input-receiverPort">Receiver Port</label>
29
+ <input type="text" id="node-config-input-receiverPort" placeholder="Receiver Port">
30
+ </div>
31
+ <div class="form-row">
32
+ <label for="node-config-input-siaAccount">SIA Account</label>
33
+ <input type="text" id="node-config-input-siaAccount" placeholder="SIA Account">
34
+ </div>
35
+ <div class="form-row">
36
+ <label for="node-config-input-siaPassword">SIA Password</label>
37
+ <input type="password" id="node-config-input-siaPassword" placeholder="SIA Password">
38
+ </div>
39
+ <div class="form-row">
40
+ <label for="node-config-input-encryptionEnabled">Encryption Enabled</label>
41
+ <input type="checkbox" id="node-config-input-encryptionEnabled" style="display: inline-block; width: auto; vertical-align: middle;">
42
+ </div>
43
+ <div class="form-row">
44
+ <label for="node-config-input-passwordInHex">Password in Hex</label>
45
+ <input type="checkbox" id="node-config-input-passwordInHex" style="display: inline-block; width: auto; vertical-align: middle;">
46
+ </div>
47
+ </script>
package/SIA_server.js ADDED
@@ -0,0 +1,14 @@
1
+ module.exports = function(RED) {
2
+ function SIAServerNode(config) {
3
+ RED.nodes.createNode(this, config);
4
+ // Store the configuration values
5
+ this.name = config.name;
6
+ this.receiverIP = config.receiverIP;
7
+ this.receiverPort = config.receiverPort;
8
+ this.siaAccount = config.siaAccount;
9
+ this.siaPassword = config.siaPassword;
10
+ this.encryptionEnabled = config.encryptionEnabled;
11
+ this.passwordInHex = config.passwordInHex;
12
+ }
13
+ RED.nodes.registerType("SIA-server", SIAServerNode);
14
+ };
package/icon.png ADDED
Binary file
package/icon.svg ADDED
@@ -0,0 +1,9 @@
1
+ <svg xmlns="http://www.w3.org/2000/svg" height="48" width="48">
2
+ <path d="
3
+ m 24 26.05 M 9 45 Q 7.8 45 6.9 44.1 Q 6 43.2 6 42 V 5 q 0 -1.2 0.9 -2.1 q 0.9 -0.9 2.1 -0.9 h 30 q 1.2 0 2.1 0.9 q 0.9 0.9 0.9 2.1 V 25.7 Q 41.3 25.3 40.55 25.075 Q 39.8 24.85 39 24.65 V 5 H 9 V 42 H 24.3 Q 24.65 42.85 25.05 43.575 T 26 45 Z M 34.65 47 L 34.4 44.6 Q 33.4 44.3 32.35 43.725 Q 31.3 43.15 30.65 42.45 L 28.55 43.45 L 26.8 40.75 L 28.7 39.25 Q 28.45 38.1 28.45 37.175 Q 28.45 36.25 28.7 35.1 L 26.8 33.6 L 28.55 30.85 L 30.65 31.85 Q 31.3 31.25 32.35 30.65 Q 33.4 30.05 34.4 29.75 L 34.65 27.3 H 37.65 L 37.95 29.75 Q 38.95 30.05 40 30.65 Q 41.05 31.25 41.7 31.85 L 43.8 30.85 L 45.55 33.6 L 43.65 35.1 Q 43.9 36.25 43.9 37.175 Q 43.9 38.1 43.65 39.25 L 45.55 40.75 L 43.8 43.45 L 41.7 42.45 Q 41.05 43.15 40 43.725 Q 38.95 44.3 37.95 44.6 L 37.65 47 Z M 36.15 42.25 Q 38.35 42.25 39.8 40.8 Q 41.25 39.35 41.25 37.15 T 39.8 33.5 Q 38.35 32.05 36.15 32.05 T 32.5 33.5 Q 31.05 34.95 31.05 37.15 T 32.5 40.8 Q 33.95 42.25 36.15 42.25 Z
4
+ " />
5
+ </svg>
6
+
7
+ <!--
8
+ M24 21.05ZM9 40q-1.2 0-2.1-.9Q6 38.2 6 37V7q0-1.2.9-2.1Q7.8 4 9 4h30q1.2 0 2.1.9.9.9.9 2.1v13.7q-.7-.4-1.45-.625-.75-.225-1.55-.425V7H9v28.15q2.95-2.75 6.675-4.475Q19.4 28.95 23.75 28.9q-.2.7-.3 1.45-.1.75-.1 1.55-3.15.1-6.1 1.275-2.95 1.175-5.5 3.375V37H24.3q.35.85.75 1.575T26 40Zm15.1-15.05q.4 0 .775-.025t.775-.125q.95-1.3 2.175-2.375Q29.05 21.35 30.5 20.65q.25-.6.375-1.25T31 18.05q0-2.9-2-4.9-2-2-4.9-2-2.9 0-4.9 2-2 2-2 4.9 0 2.9 2 4.9 2 2 4.9 2Zm0-3q-1.6 0-2.75-1.15t-1.15-2.75q0-1.6 1.15-2.75t2.75-1.15q1.6 0 2.75 1.15T28 18.05q0 1.6-1.15 2.75t-2.75 1.15ZM34.65 42l-.25-2.4q-1-.3-2.05-.875-1.05-.575-1.7-1.275l-2.1 1-1.75-2.7 1.9-1.5q-.25-1.15-.25-2.075 0-.925.25-2.075l-1.9-1.5 1.75-2.75 2.1 1q.65-.6 1.7-1.2 1.05-.6 2.05-.9l.25-2.45h3l.3 2.45q1 .3 2.05.9 1.05.6 1.7 1.2l2.1-1 1.75 2.75-1.9 1.5q.25 1.15.25 2.075 0 .925-.25 2.075l1.9 1.5-1.75 2.7-2.1-1q-.65.7-1.7 1.275-1.05.575-2.05.875l-.3 2.4Zm1.5-4.75q2.2 0 3.65-1.45 1.45-1.45 1.45-3.65T39.8 28.5q-1.45-1.45-3.65-1.45T32.5 28.5q-1.45 1.45-1.45 3.65t1.45 3.65q1.45 1.45 3.65 1.45Z
9
+ -->
package/package.json ADDED
@@ -0,0 +1,19 @@
1
+ {
2
+ "name": "@jotiotech/node-red-sia-premise-device",
3
+ "version": "0.1.0",
4
+ "engines": {
5
+ "node" : ">=12.0.0"
6
+ },
7
+ "license": "MIT",
8
+ "description": "",
9
+ "dependencies": {},
10
+ "keywords": [
11
+ "node-red", "parsing"
12
+ ],
13
+ "node-red": {
14
+ "version" : ">=1.0.0",
15
+ "nodes": {
16
+ "SIA_device": "SIA_device.js"
17
+ }
18
+ }
19
+ }
@@ -0,0 +1,22 @@
1
+ 'use strict';
2
+ const __importDefault = (this && this.__importDefault) || function (module_) {
3
+ return (module_ && module_.__esModule) ? module_ : {default: module_};
4
+ };
5
+
6
+ const Net = require('node:net');
7
+
8
+ Object.defineProperty(exports, '__esModule', {value: true});
9
+
10
+ class SIADevice {
11
+ constructor(serverConfig) {
12
+ console.log(serverConfig);
13
+ }
14
+
15
+ connect() {
16
+
17
+ }
18
+
19
+
20
+ }
21
+ exports.default = SIADevice;
22
+ // # sourceMappingURL=BJ_parser.js.map