Browse Source

Add Status Schuedle endpoint

Paul Molluzzo 9 years ago
parent
commit
5c4aa1e599
2 changed files with 13 additions and 0 deletions
  1. 4 0
      src/hydrawise.js
  2. 9 0
      test/index.js

+ 4 - 0
src/hydrawise.js

@@ -23,6 +23,10 @@ class Hydrawise {
   customerdetails() {
   customerdetails() {
     return this.request('GET', 'customerdetails', {type: 'controllers'});
     return this.request('GET', 'customerdetails', {type: 'controllers'});
   }
   }
+
+  statusschedule(tag = '', hours = 168) {
+    return this.request('GET', 'statusschedule', {tag, hours});
+  }
 }
 }
 
 
 export default Hydrawise;
 export default Hydrawise;

+ 9 - 0
test/index.js

@@ -11,3 +11,12 @@ test('Customer Details', t => {
     t.pass();
     t.pass();
   });
   });
 });
 });
+
+test('Status Schedule', t => {
+  return hydrawise.statusschedule().then(data => {
+    if (data.error_msg) {
+      t.fail(`Error: ${data.error_msg}`);
+    }
+    t.pass();
+  });
+});