some changes to global mode
This commit is contained in:
parent
0a56812189
commit
9fbe822c33
@ -161,6 +161,7 @@ const mqttClient = function(events) {
|
||||
|
||||
this.client.on('updateState', function(newStatus) {
|
||||
globalMode = (newStatus === 0) ? 'FanOff' : 'FanOn';
|
||||
logger.info('updateState changed to: ', globalMode);
|
||||
});
|
||||
|
||||
this.client.on('message', function(topic, message) {
|
||||
|
@ -44,6 +44,7 @@ wemo.discover(function(deviceInfo) {
|
||||
// Handle BinaryState events
|
||||
wemoClient.on('binaryState', function(value) {
|
||||
logger.debug('Binary State changed to: %s', value);
|
||||
busEmitter.emit('updateState', value);
|
||||
});
|
||||
|
||||
// Turn the switch on
|
||||
@ -55,8 +56,8 @@ busEmitter.on('changeState', function(mode) {
|
||||
|
||||
if (wemoClient !== null) {
|
||||
wemoClient.setBinaryState(mode);
|
||||
let newState = wemoClient.getBinaryState();
|
||||
busEmitter.emit('updateState', newState);
|
||||
// let newState = wemoClient.getBinaryState();
|
||||
// busEmitter.emit('updateState', newState);
|
||||
} else {
|
||||
console.error('No wemoClient');
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user