Skip to content

Commit

Permalink
Version 0.2.1
Browse files Browse the repository at this point in the history
* Added cacheDir option to config
  • Loading branch information
naofireblade committed Oct 8, 2017
1 parent 57483e2 commit bf8bf64
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 6 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@

## 0.2.0

* Added persistence
* Added persistence

## 0.2.1

* Added cacheDir option to config
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
```
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,16 @@ module.exports = function (homebridge) {
function LogicPlatform(log, config) {
this.log = log;
this.config = config;
this.cacheDir = config['cacheDir'];
}

LogicPlatform.prototype = {
accessories: function(callback) {
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();
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": [
Expand Down

0 comments on commit bf8bf64

Please sign in to comment.