some changes to global mode
This commit is contained in:
parent
6ff04e4b47
commit
656c1920f1
@ -62,6 +62,11 @@ const mqttClient = function(events) {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.updateGlobal = function(newStatus) {
|
||||||
|
globalMode = (newStatus === 0) ? 'FanOff' : 'FanOn';
|
||||||
|
logger.info('updateGlobal changed to: ', globalMode);
|
||||||
|
};
|
||||||
|
|
||||||
this.storeData = function(data, alt) {
|
this.storeData = function(data, alt) {
|
||||||
if (!this.first) {
|
if (!this.first) {
|
||||||
this.first = true;
|
this.first = true;
|
||||||
|
@ -44,7 +44,7 @@ wemo.discover(function(deviceInfo) {
|
|||||||
// Handle BinaryState events
|
// Handle BinaryState events
|
||||||
wemoClient.on('binaryState', function(value) {
|
wemoClient.on('binaryState', function(value) {
|
||||||
logger.debug('Binary State changed to: %s', value);
|
logger.debug('Binary State changed to: %s', value);
|
||||||
busEmitter.emit('updateState', value);
|
mqttClient.updateGlobal(value);
|
||||||
});
|
});
|
||||||
|
|
||||||
// Turn the switch on
|
// Turn the switch on
|
||||||
|
Loading…
Reference in New Issue
Block a user