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('');
if (mode !== globalMode) {
logger.info('Sending..');
logger.info('Go for change state');
globalMode = mode;
logger.debug('Global Mode now A:', globalMode);
/* Request(url, function (error, response, body) {
logger.debug(response, body);
}); */
@ -95,7 +96,8 @@ const mqttClient = function(events) {
if (globalMode === 'FanOff') {
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 {
logger.info('Fans on, temp should not be less than 22.5');
mode = (parseFloat(this.livingRoom.temp) <= 22.5) ? 'FanOn' : 'FanOff';