something

This commit is contained in:
Martin Donnelly 2016-11-23 19:05:21 +00:00
parent ecac472f35
commit eb5c9ed560

View File

@ -21,13 +21,15 @@ var lastDispatch = 0;
busEmitter.on('send', function (mode) {
var url = ['https://maker.ifttt.com/trigger/', mode, '/with/key/cWvECkeiyAPwmiOPBkXL2D'].join('');
console.log(url);
if (mode !== globalMode)
{
console.log('Sending..');
globalMode = mode;
request(url, function (error, response, body) {
if (!error && response.statusCode === 200) {
console.log(body);
}
// if (!error && response.statusCode === 200) {
console.log(response, body);
// }
});
var d = new Date();
@ -117,7 +119,7 @@ logger.debug('GlobalMode',globalMode);
this.livingRoom.temp = parseFloat(json.temp);
console.log('lr:',this.livingRoom.temp, this.livingRoom.temp >= 22.6);
if (this.livingRoom.temp >= 23) {
if (this.livingRoom.temp >= 22.7) {
console.log('Max temp reached, turn off' );
busEmitter.emit('send', 'FanOff');
}