Procházet zdrojové kódy

Add Status Schuedle endpoint

Paul Molluzzo před 9 roky
rodič
revize
5c4aa1e599
2 změnil soubory, kde provedl 13 přidání a 0 odebrání
  1. 4 0
      src/hydrawise.js
  2. 9 0
      test/index.js

+ 4 - 0
src/hydrawise.js

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

+ 9 - 0
test/index.js

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