Sen descrición

Paul Molluzzo 551631d68b Add Travis CI badge to README %!s(int64=9) %!d(string=hai) anos
test bb6d4f6202 Upgrade to using Node 6 engine and removing babel prebuild processes %!s(int64=9) %!d(string=hai) anos
.editorconfig 317addd0af initial commit %!s(int64=9) %!d(string=hai) anos
.gitignore bb6d4f6202 Upgrade to using Node 6 engine and removing babel prebuild processes %!s(int64=9) %!d(string=hai) anos
.npmignore a565848cca Add npmignore %!s(int64=9) %!d(string=hai) anos
.travis.yml a3598d3f15 Add Travis config %!s(int64=9) %!d(string=hai) anos
README.md 551631d68b Add Travis CI badge to README %!s(int64=9) %!d(string=hai) anos
index.js bb6d4f6202 Upgrade to using Node 6 engine and removing babel prebuild processes %!s(int64=9) %!d(string=hai) anos
package.json bb6d4f6202 Upgrade to using Node 6 engine and removing babel prebuild processes %!s(int64=9) %!d(string=hai) anos

README.md

Hydrawise API

Build Status

This is a client for the Hydrawise API. Hydrawise is an internet-controlled home irrigation system.

It provides access to the following endpoints:

Usage

Initial Setup

const Hydrawise = require('hydrawise-api');
const myHydrawise = Hydrawise(YOUR_API_KEY);

Customer Details

Get cusetomer info.

myHydrawise.customerdetails()
  .then(data => console.log(data))
  .catch(error => console.log(error));

Status Schedule

Get the status of a controller. You can pass the param hydrawise_all or a specific tag or leave empty for the current controller. The second parameter is how far in advance (in hours) you want to get the schedule, and it will default to the maximum of 168.

myHydrawise.statusschedule()
  .then(data => console.log(data))
  .catch(error => console.log(error));

Set Controller

Set a controller for controller-specific commands.

Note: This endpoint seems to not respond with any data, so a non-error is a "pass" I guess?

myHydrawise.setcontroller(controller_id)
  .then()
  .catch(error => console.log(error));

Set Zone

This is how you set a zone to run, suspend, or stop. The params are an action and additional params period_id, custom for a duration in seconds, and relay_id for a specific zone.

// run all for 10 minutes
myHydrawise.setzone('runall', {period_id: '666', custom: '600'})
  .then(data => console.log(data))
  .catch(error => console.log(error));

// stop all
myHydrawise.setzone('stopall')
  .then(data => console.log(data))
  .catch(error => console.log(error));

// run zone for 5 minutes
myHydrawise.setzone('run', {period_id: '123', custom: '300', relay_id: your_relay_id})
  .then(data => console.log(data))
  .catch(error => console.log(error));

MIT

©2016 Paul Molluzzo