Fixed bug due to which raw action didn't work.
This commit is contained in:
@@ -14,7 +14,7 @@ module.exports = function(RED) {
|
|||||||
var ip = node.ip;
|
var ip = node.ip;
|
||||||
var login = node.credentials.login;
|
var login = node.credentials.login;
|
||||||
var pass = node.credentials.pass;
|
var pass = node.credentials.pass;
|
||||||
var action = '';
|
var action;
|
||||||
|
|
||||||
switch (parseInt(node.action)) {
|
switch (parseInt(node.action)) {
|
||||||
case 0:
|
case 0:
|
||||||
@@ -30,13 +30,15 @@ module.exports = function(RED) {
|
|||||||
action = '/system/reboot';
|
action = '/system/reboot';
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
action = msg.payload;
|
// action = msg.payload;
|
||||||
|
action = '';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
this.on('input', function(msg) {
|
this.on('input', function(msg) {
|
||||||
|
if (action == '') action = msg.payload;
|
||||||
var connection = new mikrotik(ip, login, pass);
|
var connection = new mikrotik(ip, login, pass);
|
||||||
connection.connect(function(conn) {
|
connection.connect(function(conn) {
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "node-red-contrib-mikrotik",
|
"name": "node-red-contrib-mikrotik",
|
||||||
"version": "0.0.2",
|
"version": "0.0.3",
|
||||||
"description": "Node to work with Mikrotik WiFi router",
|
"description": "Node to work with Mikrotik WiFi router",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
"test": "echo \"Error: no test specified\" && exit 1"
|
||||||
|
|||||||
Reference in New Issue
Block a user