Subversion Repositories HomeAutomation

Rev

Rev 1660 | Rev 1666 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | SVN | RSS feed

Rev 1660 Rev 1665
Line 67... Line 67...
67
    {
67
    {
68
        Log("\033[31mNot enough parameters given.\033[0m\n");
68
        Log("\033[31mNot enough parameters given.\033[0m\n");
69
        return false;
69
        return false;
70
    }
70
    }
71
   
71
   
72
    Log("Sending reset to " + node_id + ".\n");
72
    Log("Sending reset to " + node_id + "...\n");
73
   
73
   
74
    if (!NodeExport_ResetNode(node_id))
74
    if (!NodeExport_ResetNode(node_id))
75
    {
75
    {
76
        Log("\033[31mFailed to send reset.\033[0m\n");
76
        Log("\033[31mFailed to send reset.\033[0m\n");
77
        return false;
77
        return false;
Line 82... Line 82...
82
    Console_PreventDefaultPrompt();
82
    Console_PreventDefaultPrompt();
83
 
83
 
84
    return true;
84
    return true;
85
}
85
}
86
Console_RegisterCommand(Node_Reset, function(arg_index, args) { return Console_StandardAutocomplete(arg_index, args, Node_GetAvailableIds()); });
86
Console_RegisterCommand(Node_Reset, function(arg_index, args) { return Console_StandardAutocomplete(arg_index, args, Node_GetAvailableIds()); });
-
 
87
 
-
 
88
function Node_GetInformation(node_id)
-
 
89
{
-
 
90
    if (arguments.length < 1)
-
 
91
    {
-
 
92
        Log("\033[31mNot enough parameters given.\033[0m\n");
-
 
93
        return false;
-
 
94
    }
-
 
95
   
-
 
96
    var result = NodeExport_GetNodeInformation(node_id);
-
 
97
   
-
 
98
    if (!result)
-
 
99
    {
-
 
100
        Log("\033[31mNo node with id " + node_id + " found.\033[0m\n");
-
 
101
        return false;
-
 
102
    }
-
 
103
   
-
 
104
    var date = new Date(result["LastActive"] * 1000);
-
 
105
   
-
 
106
    Log("Id: " + result["Id"] + "\n");
-
 
107
    Log("Valid: " + result["Valid"] + "\n");
-
 
108
    Log("BiosVersion: " + result["BiosVersion"] + "\n");
-
 
109
    Log("DeviceType: " + result["DeviceType"] + "\n");
-
 
110
    Log("HasApplication: " + result["HasApplication"] + "\n");
-
 
111
    Log("LastActive: " + date.toString() + "\n");
-
 
112
   
-
 
113
    return true;
-
 
114
}
-
 
115
Console_RegisterCommand(Node_GetInformation, function(arg_index, args) { return Console_StandardAutocomplete(arg_index, args, Node_GetAvailableIds()); });