From bf8bf641a24030e739153bd33be4360d4f99b787 Mon Sep 17 00:00:00 2001 From: naofireblade Date: Sun, 8 Oct 2017 05:13:39 +0200 Subject: [PATCH] Version 0.2.1 * Added cacheDir option to config --- CHANGELOG.md | 6 +++++- README.md | 5 +++-- index.js | 4 ++-- package.json | 2 +- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 51b5abe..1b6da74 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,4 +10,8 @@ ## 0.2.0 -* Added persistence \ No newline at end of file +* Added persistence + +## 0.2.1 + +* Added cacheDir option to config \ No newline at end of file diff --git a/README.md b/README.md index f2fb152..9684105 100644 --- a/README.md +++ b/README.md @@ -35,13 +35,14 @@ Feel free to leave any feedback [here](https://github.com/naofireblade/homebridg ### Configuration -Add the following information to your config file. Make sure to add your API key and provide your city or postal code. +Add the following information to your config file. Set a writable folder as cache directory. ```json "platforms": [ { "platform": "Logic", - "name": "Logic" + "name": "Logic", + "cacheDir": "/var/lib/homebridge/logic" } ] ``` diff --git a/index.js b/index.js index 087127e..257fe47 100644 --- a/index.js +++ b/index.js @@ -59,6 +59,7 @@ module.exports = function (homebridge) { function LogicPlatform(log, config) { this.log = log; this.config = config; + this.cacheDir = config['cacheDir']; } LogicPlatform.prototype = { @@ -66,9 +67,8 @@ LogicPlatform.prototype = { this.variableNamePlaceholder = variableNamePlaceholder; this.hintPlaceholder = hintPlaceholder; - let directory = "/var/lib/homebridge-dev/logic"; this.storage = require('node-persist'); - this.storage.initSync({dir:directory}); + this.storage.initSync({dir:this.cacheDir}); // General information service for all accessories in this platform this.informationService = new Service.AccessoryInformation(); diff --git a/package.json b/package.json index 108072f..36fb92e 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "homebridge-logic", - "version": "0.2.0", + "version": "0.2.1", "description": "A plugin for homebridge to create supercharged variables.", "license": "MIT", "keywords": [