diff --git a/config-sample.json b/config-sample.json index 78c95854dec672ee4b312e95cfbce59314e0d44c..012739239400410c3d94b1360be4c1f8f95b0749 100644 --- a/config-sample.json +++ b/config-sample.json @@ -23,5 +23,6 @@ "entity_action": "" } } - } + }, + "config_version": 2 } diff --git a/index.js b/index.js index a402f1a82103fa1b0bd64300cbc6d96152ce0583..68d1b553d1eead852537cbae88180e287d601d6a 100644 --- a/index.js +++ b/index.js @@ -11,7 +11,13 @@ var request = require( 'request' ); /** * CONFIGURATION & SETUP */ -var config = require( './config.json' ); +var config = require( './config.json' ); + +if ( 'undefined' === typeof config.config_version || config.config_version < 2 ) { + console.error( 'Configuration is for v0.1.0 and must be updated to work with this release. Exiting!' ); + process.exit(); +} + var homeAssistantApiBase = config.home_assistant_proto + '://' + config.home_assistant_host + ':' + config.home_assistant_port + '/api/'; var client = new FlicClient( config.flicd_ip, config.flicd_port ); diff --git a/package.json b/package.json index bc98c5c5b1c441f5f7b0aafd5145da941965da1a..38b71f74f20276dbce3ac74028f8a80cef892709 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "flic-button-home-assistant-controller", - "version": "0.1.0", + "version": "0.2.0", "description": "Control Home Assistant entities with Flic buttons", "author": "Erick Hitter <contact@ethitter.com>", "license": "GPL-2.0+",