diff --git a/config-sample.json b/config-sample.json index 7da2d29ec4b005ee51f94fbc5717d03fc8902517..78c95854dec672ee4b312e95cfbce59314e0d44c 100644 --- a/config-sample.json +++ b/config-sample.json @@ -1,5 +1,6 @@ { - "arp_interface": null, + "flicd_ip": "127.0.0.1", + "flicd_port": 5551, "home_assistant_host": "localhost", "home_assistant_port": 8123, "home_assistant_proto": "http", diff --git a/index.js b/index.js index 0c3fd9c8f4f81d3ec22774be95eeed05bb02ce7a..31657f54f21a1ca20b975daf935d55daf123281a 100644 --- a/index.js +++ b/index.js @@ -4,15 +4,23 @@ * LIBRARIES */ - -var request = require( 'request' ); +var fliclib = require( './vendor/fliclib-linux-hci/clientlib/nodejs/fliclibNodeJs' ); +var FlicClient = fliclib.FlicClient; +var FlicConnectionChannel = fliclib.FlicConnectionChannel; +var FlicScanner = fliclib.FlicScanner; +var request = require( 'request' ); /** - * CONFIGURATION & EVENT BINDING + * CONFIGURATION & SETUP */ var config = require( './config.json' ); +var client = new FlicClient( config.flicd_ip, config.flicd_port ); + +/** + * BUTTON BINDING + */ Object.keys( config.buttons ).forEach( function( index ) { var buttonConfig = config.buttons[index];