zigbee2mqtt/index.js

19 lines
546 B
JavaScript
Raw Normal View History

const semver = require('semver');
const engines = require('./package.json').engines;
const version = engines.node;
if (!semver.satisfies(process.version, version)) {
console.log(`\t\tZigbee2mqtt requires node version ${version}, you are running ${process.version}!\n`); // eslint-disable-line
}
2018-04-09 08:37:21 -07:00
const Controller = require('./lib/controller');
2018-04-18 09:25:40 -07:00
const controller = new Controller();
controller.start();
2018-04-14 07:17:25 -07:00
2018-04-08 06:33:47 -07:00
process.on('SIGINT', handleQuit);
process.on('SIGTERM', handleQuit);
2018-04-08 06:00:36 -07:00
2018-04-08 06:33:47 -07:00
function handleQuit() {
2018-04-18 09:25:40 -07:00
controller.stop(() => process.exit());
2018-05-17 08:20:46 -07:00
}