"use strict";
var Cylon = require("cylon");
Cylon
.robot()
.connection("nest", { adaptor: "nest", accessToken: "ACCESS_TOKEN" })
.device("thermostat", { driver: "nest-thermostat", deviceId: "DEVICE_ID" })
.on("ready", function(bot) {
bot.thermostat.on("status", function(data) {
console.log("The Thermostat at a glance--->", data);
});
every((30).seconds(), function() {
console.log("NEST ambient temp C:", bot.thermostat.ambientTemperatureC());
console.log("NEST ambient temp F:", bot.thermostat.ambientTemperatureF());
console.log("NEST target temp F:", bot.thermostat.targetTemperatureC());
console.log("NEST target temp F:", bot.thermostat.targetTemperatureF());
bot.thermostat.read("away_temperature_high_c", function(data) {
console.log("Away Temp High C on read callback -->", data);
});
});
});
Cylon.start();