From ec7575f4dc3c52c7a5bb8b5f482f6a3664abfd2d Mon Sep 17 00:00:00 2001
From: Ben Burwell <ben@benburwell.com>
Date: Tue, 12 Jan 2016 18:17:30 -0500
Subject: Add support for alert_days and alert_minutes parameters

---
 lib/clients/refresh.js | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

(limited to 'lib')

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) {
-- 
cgit v1.2.3