diff --git a/README.md b/README.md index eb19294..ef3cd15 100755 --- a/README.md +++ b/README.md @@ -50,6 +50,8 @@ It can also receive webhooks sent by location-aware mobile apps (such as [Locati | `anyoneSensor` | optional, default: true | | `nooneSensor` | optional, default: false | | `webhookPort` | optional, default: 51828 | +| `roomName` | optional, add a room name to AnyOne and No One sensors, default: "" | + | `cacheDirectory` | optional, default: "./.node-persist/storage" | | `pingInterval` | optional, in milliseconds, default: 10000, if set to -1 than the ping mechanism will not be used | | `ignoreReEnterExitSeconds` | optional, in minutes, default: 0, if set to 0 than every enter/exit will trigger state change otherwise the state will only change if no re-enter/exit occurs in specified number of seconds | diff --git a/index.js b/index.js index 8f07df6..a46ccd5 100755 --- a/index.js +++ b/index.js @@ -32,9 +32,18 @@ function PeoplePlatform(log, config){ this.pingInterval = config["pingInterval"] || 10000; this.ignoreReEnterExitSeconds = config["ignoreReEnterExitSeconds"] || 0; this.people = config['people']; + this.roomName = config["roomName"] || ""; this.storage = require('node-persist'); this.storage.initSync({dir:this.cacheDirectory}); this.webhookQueue = []; + + if (this.roomName) { + SENSOR_ANYONE = 'Anyone' + " @ " + this.roomName; + SENSOR_NOONE = 'No One' + " @ " + this.roomName; + } else { + SENSOR_ANYONE = 'Anyone'; + SENSOR_NOONE = 'No One'; + } } PeoplePlatform.prototype = {