MVP
This commit is contained in:
parent
5fadfd2000
commit
a92a71d5e7
@ -131,7 +131,7 @@ module.exports = {
|
|||||||
}
|
}
|
||||||
// this.emit('announcement', 'Message is from the frontend, updating state');
|
// this.emit('announcement', 'Message is from the frontend, updating state');
|
||||||
// Update the state
|
// Update the state
|
||||||
state[msgJson.name].on = msgJson.on;
|
state[msgJson.name] = msgJson;
|
||||||
// Emit the state change
|
// Emit the state change
|
||||||
this.emit('stateChange', oldState, state);
|
this.emit('stateChange', oldState, state);
|
||||||
} else if (topic === 'hestia/command/startup') {
|
} else if (topic === 'hestia/command/startup') {
|
||||||
|
@ -313,6 +313,14 @@ module.exports = {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check if the feed rate changed
|
||||||
|
if (oldState.auger.feedRate !== state.auger.feedRate) {
|
||||||
|
module.exports.log(`Auger feed rate changed to ${state.auger.feedRate}ms.`, 'DEBUG');
|
||||||
|
return new Promise((resolve, reject) => {
|
||||||
|
resolve();
|
||||||
|
});
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Wait for all promises to resolve
|
// Wait for all promises to resolve
|
||||||
|
@ -58,7 +58,6 @@ setInterval(fn.routines.cycleAuger, config.augerTotalCycleTime);
|
|||||||
/***************************************************************************************/
|
/***************************************************************************************/
|
||||||
process.comlink.on('stateChange', (oldState, state) => {
|
process.comlink.on('stateChange', (oldState, state) => {
|
||||||
fn.log(`ComLink: State change detected.`, 'INFO');
|
fn.log(`ComLink: State change detected.`, 'INFO');
|
||||||
fn.log(`ComLink: Old State: ${JSON.stringify(oldState.auger)}\nNew State: ${JSON.stringify(state.auger)}`, 'DEBUG');
|
|
||||||
fn.handlers.stateChange(oldState, state);
|
fn.handlers.stateChange(oldState, state);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user