diff options
author | Ben Burwell <github@benburwell.com> | 2016-01-12 18:27:54 -0500 |
---|---|---|
committer | Ben Burwell <github@benburwell.com> | 2016-01-12 18:27:54 -0500 |
commit | 1afea8fece81d6311b40509bf51a853ae946764c (patch) | |
tree | b1753847741e4919acadc8ea59742a417283c626 /lib | |
parent | 1a4a8c5e8dbb1e2d3b3da87e82cfe734537a503b (diff) | |
parent | ec7575f4dc3c52c7a5bb8b5f482f6a3664abfd2d (diff) |
Merge pull request #4 from benburwell/alert-filteringv1.1.0
Add support for alert_days and alert_minutes parameters
Diffstat (limited to 'lib')
-rw-r--r-- | lib/clients/refresh.js | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/clients/refresh.js b/lib/clients/refresh.js index 7b9fde7..a88d899 100644 --- a/lib/clients/refresh.js +++ b/lib/clients/refresh.js @@ -92,8 +92,14 @@ RefreshClient.prototype.getDevice = function(id) { return this._doRequest('/devices/' + id); }; -RefreshClient.prototype.getAlerts = function() { - return this._doRequest('/alerts'); +RefreshClient.prototype.getAlerts = function(options) { + var url = '/alerts'; + if (options && options.alert_minutes) { + url += '?alert_minutes=' + options.alert_minutes; + } else if (options && options.alert_days) { + url += '?alert_days=' + options.alert_days; + } + return this._doRequest(url); }; RefreshClient.prototype.getAlert = function(id) { |