Automatically turn the projector on at the start of a meeting

This commit is contained in:
Martin Donnelly 2016-05-20 16:28:26 +01:00
parent 8628d6a89b
commit fccb078638
4 changed files with 11 additions and 4 deletions

4
app.js
View File

@ -84,8 +84,8 @@ busEmitter.on('lightingOff', lighting_v1.doLightsOff);
busEmitter.on('heatingOn', mqttConnect.heatingOn);
busEmitter.on('heatingOff', mqttConnect.heatingOff);
busEmitter.on('projectorOn', mqttConnect.projectorOn);
busEmitter.on('projectorOff', mqttConnect.projectorOff);
busEmitter.on('projectorOn', projector_v1.doProjectorOn);
busEmitter.on('projectorOff', projector_v1.doProjectorOff);
busEmitter.on('connectWS', mqttConnect.connectWS);

View File

@ -106,7 +106,6 @@ module.exports = {
var destinationName = mqttConfig.prefix + this.projector + '/cmd/' + 'ON' + '/fmt/json';
this.client.publish(destinationName, 'ON', _callback);
this.emitter.emit('sendSocket',packet);
logger.debug('Storing status...');
this.updateStatus('projector', packet);
},

View File

@ -233,6 +233,7 @@ officeController.prototype.createMeeting = function(obj,delayStart) {
// Lets turn on some lights!
eventBus.emit('lightingOn','o');
eventBus.emit('lightingOn','n');
eventBus.emit('projectorOn');
logger.debug('masterCRON', self.masterCRON);
eventBus.emit('sendSocket', {id: 'calendar',current: curMeeting});

View File

@ -9,10 +9,12 @@
var mqttConnect;
function doProjectorOn() {
console.log('+ projector_v1 / doProjectorOn');
mqttConnect.doConnection().projectorOn();
}
function doProjectorOff() {
console.log('+ projector_v1 / doProjectorOff');
mqttConnect.doConnection().projectorOff();
}
@ -64,6 +66,11 @@ module.exports = {
},
subscribe: function(socket) {
this.socket.subscribe('Projector','ProjectorDataReceived');
}
},
doProjectorOn: function() {
doProjectorOn();
}, doProjectorOff: function() {
doProjectorOff();
}
};