domotz-remote-pawn
Version:
Domotz Agent
40 lines (35 loc) • 1.5 kB
JavaScript
const q = require('q');
/** This file is part of Domotz Agent.
* Copyright (C) 2016 Domotz Ltd
*
* Domotz Agent is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Domotz Agent is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Domotz Agent. If not, see <http://www.gnu.org/licenses/>.
*
* Automatically sets the wake on lan command to all the devices that have it enabled and are offline
*
* Created by Fausto Lelli <fausto@domotz.com> on 31/3/2017.
*/
var handler = function (resourceLocator) {
var myConsole = resourceLocator.log.decorateLogs();
var status = resourceLocator.status;
if (!status.canExecuteEventHandler()) {
myConsole.info('Pawn in restricted or updating mode. Cannot perform network info command');
return q.resolve();
}
require('../../commands/network/information')
.command(null, resourceLocator)
.execute(function (results) {
myConsole.info(' Network Info Call performed, results %s', results);
});
};
module.exports.handler = handler;