Code cleanup

Much better organization and ease-of-use now that the proof of concept is established. Still an awful lot to do here, but I'm getting the hang of the whole node.js thing.
Also moved the actual test functionality out to a test script so the module itself doesn't execute anything.
This commit is contained in:
Parnic
2018-03-30 10:27:01 -05:00
parent c1234187ca
commit af02f60791
2 changed files with 179 additions and 77 deletions

18
test.js Executable file
View File

@ -0,0 +1,18 @@
const ScreenLogic = require('./index');
var finder = new ScreenLogic.FindUnits();
finder.on('serverFound', function(server) {
var client = new ScreenLogic.UnitConnection(server);
client.on('loggedIn', function() {
this.getPoolStatus();
this.getControllerConfig();
}).on('poolStatus', function(status) {
}).on('controllerConfig', function(config) {
client.close();
finder.close();
});
client.connect();
});
finder.search();