Fixed bug due to which raw action didn't work.

This commit is contained in:
bladerunner2020
2016-04-01 07:43:49 +03:00
parent d1ed17b3aa
commit a113f4cfb7
2 changed files with 5 additions and 3 deletions

View File

@@ -14,7 +14,7 @@ module.exports = function(RED) {
var ip = node.ip;
var login = node.credentials.login;
var pass = node.credentials.pass;
var action = '';
var action;
switch (parseInt(node.action)) {
case 0:
@@ -30,13 +30,15 @@ module.exports = function(RED) {
action = '/system/reboot';
break;
case 9:
action = msg.payload;
// action = msg.payload;
action = '';
break;
}
this.on('input', function(msg) {
if (action == '') action = msg.payload;
var connection = new mikrotik(ip, login, pass);
connection.connect(function(conn) {

View File

@@ -1,6 +1,6 @@
{
"name": "node-red-contrib-mikrotik",
"version": "0.0.2",
"version": "0.0.3",
"description": "Node to work with Mikrotik WiFi router",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"