automation of motor switch test2

master
varun 1 year ago
parent 6d5b4854bc
commit e5e691c37b

@ -1082,12 +1082,13 @@ const checkAutoMode = async () => {
for (const tank of tanks) {
if (tank.auto_mode === "active") {
console.log("this is automation " + tank.tankName)
const waterLevel = parseInt(tank.waterlevel, 10);
const capacity = parseInt(tank.capacity, 10);
const autoMinPercentage = parseInt(tank.auto_min_percentage, 10);
const autoMaxPercentage = parseInt(tank.auto_max_percentage, 10);
const currentPercentage = (waterLevel / capacity) * 100;
console.log("this is automation percentage " + currentPercentage)
const now = moment().format('DD-MMM-YYYY-HH-mm');
if (capacity > 0) {

Loading…
Cancel
Save