From df4d3bc91c2db2577a7d4d5d89a154c34bc15753 Mon Sep 17 00:00:00 2001 From: Jason Bruce Date: Thu, 1 Apr 2021 09:30:40 -0400 Subject: [PATCH] - better handling of led for kiln element heating --- public/assets/js/picoreflow.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/public/assets/js/picoreflow.js b/public/assets/js/picoreflow.js index d341af8..4f0e3e7 100644 --- a/public/assets/js/picoreflow.js +++ b/public/assets/js/picoreflow.js @@ -555,17 +555,11 @@ $(document).ready(function() } $('#act_temp').html(parseInt(x.temperature)); - - //if (x.heat > 0.5) { $('#heat').addClass("ds-led-heat-active"); } else { $('#heat').removeClass("ds-led-heat-active"); } if (x.heat > 0.0) { - $('#heat').addClass("ds-led-heat-active") - setTimeout(function() { $('#heat').removeClass("ds-led-heat-active") }, (x.heat*1000.0)-50) + setTimeout(function() { $('#heat').addClass("ds-led-heat-active") }, 0 ) + setTimeout(function() { $('#heat').removeClass("ds-led-heat-active") }, (x.heat*1000.0)-5) } - else { - $('#heat').removeClass("ds-led-heat-active") - } - if (x.cool > 0.5) { $('#cool').addClass("ds-led-cool-active"); } else { $('#cool').removeClass("ds-led-cool-active"); } if (x.air > 0.5) { $('#air').addClass("ds-led-air-active"); } else { $('#air').removeClass("ds-led-air-active"); } if (x.temperature > hazardTemp()) { $('#hazard').addClass("ds-led-hazard-active"); } else { $('#hazard').removeClass("ds-led-hazard-active"); }