diff --git a/lib/mqtt/mqttClient.js b/lib/mqtt/mqttClient.js index 0b442d3..886fc14 100644 --- a/lib/mqtt/mqttClient.js +++ b/lib/mqtt/mqttClient.js @@ -124,8 +124,12 @@ const mqttClient = function(events) { logger.info('LR temp:', this.livingRoom.temp); const data = {id: 'temperature', data: {mode: globalMode, temp: this.livingRoom.temp}}; - events.emit('sendIFTTT', mode); - events.emit('sendSocket', data); + if (this.livingRoom.temp !== 0) + { + events.emit('sendIFTTT', mode); + events.emit('sendSocket', data); + } + setTimeout(this.fanTimer.bind(this), mod + 10); };