This commit is contained in:
Martin Donnelly 2017-01-07 22:48:51 +00:00
parent 564347a448
commit 45b7dc8e21

View File

@ -42,8 +42,9 @@ const mqttClient = function(events) {
const url = ['https://maker.ifttt.com/trigger/', mode, '/with/key/cWvECkeiyAPwmiOPBkXL2D'].join(''); const url = ['https://maker.ifttt.com/trigger/', mode, '/with/key/cWvECkeiyAPwmiOPBkXL2D'].join('');
if (mode !== globalMode) { if (mode !== globalMode) {
logger.info('Sending..'); logger.info('Go for change state');
globalMode = mode; globalMode = mode;
logger.debug('Global Mode now A:', globalMode);
/* Request(url, function (error, response, body) { /* Request(url, function (error, response, body) {
logger.debug(response, body); logger.debug(response, body);
}); */ }); */
@ -95,7 +96,8 @@ const mqttClient = function(events) {
if (globalMode === 'FanOff') { if (globalMode === 'FanOff') {
logger.info('Fans off, temp should be <= 19.5'); logger.info('Fans off, temp should be <= 19.5');
mode = (parseFloat(this.livingRoom.temp) <= 19.5) ? 'FanOn' : 'FanOff'; // mode = (parseFloat(this.livingRoom.temp) <= 19.5) ? 'FanOn' : 'FanOff';
mode = (parseFloat(this.livingRoom.temp) <= 20.5) ? 'FanOn' : 'FanOff';
} else { } else {
logger.info('Fans on, temp should not be less than 22.5'); logger.info('Fans on, temp should not be less than 22.5');
mode = (parseFloat(this.livingRoom.temp) <= 22.5) ? 'FanOn' : 'FanOff'; mode = (parseFloat(this.livingRoom.temp) <= 22.5) ? 'FanOn' : 'FanOff';