test for stopping motor

master
Varun 10 months ago
parent 40481f7591
commit bb9dbc01f2

@ -2132,6 +2132,8 @@ else if (currentWaterLevel >= highWaterThreshold) {
const currentWaterPercentage = (currentWaterLevel / parseInt(supplierTank.capacity.replace(/,/g, ''), 10)) * 100; const currentWaterPercentage = (currentWaterLevel / parseInt(supplierTank.capacity.replace(/,/g, ''), 10)) * 100;
if (new Date() >= thresholdTime || currentWaterPercentage <= lowWaterThreshold) { if (new Date() >= thresholdTime || currentWaterPercentage <= lowWaterThreshold) {
console.log(new Date(),"new date")
console.log(thresholdTime,"thresholdTime")
console.log("motor stopping because it entered this condition") console.log("motor stopping because it entered this condition")
await Tank.updateOne( await Tank.updateOne(
{ customerId, "connections.inputConnections.motor_id": motorId }, { customerId, "connections.inputConnections.motor_id": motorId },

Loading…
Cancel
Save