0.0.1 • Published 8 years ago

nest-cloud-api v0.0.1

Weekly downloads
3
License
ISC
Repository
github
Last release
8 years ago

node-nest-cloud-api

npm package

A simple way to interface with Nest devices using official Rest API.

Installation

Install and add it to your package.json with:

$ npm install nest-cloud-api --save

Usage

var Nest = require('nest-cloud-api');

var apiAccessToken = 'foobar'; // this is the Nest API access_token. To get it you can use https://github.com/denouche/node-nest-oauth2
var myNest = new Nest(apiAccessToken);

myNest.request()
    .then(function(data) {
   		console.info(data);
    });

myNest.request({ method: 'PUT', uri: '/devices/thermostats/<thermostatId>', body: { target_temperature_c: 21.5 }})
    .then(function(data) {
   		console.info('success!');
    });