From b55bdf84d1a7cb285c43a71cb2e8db4392e6b6a6 Mon Sep 17 00:00:00 2001 From: Rahmadi Trimananda Date: Thu, 8 Aug 2019 09:21:15 -0700 Subject: [PATCH] Update auto-humidity-vent.groovy --- official/auto-humidity-vent.groovy | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/official/auto-humidity-vent.groovy b/official/auto-humidity-vent.groovy index 91e6385..da9ee3a 100755 --- a/official/auto-humidity-vent.groovy +++ b/official/auto-humidity-vent.groovy @@ -226,19 +226,19 @@ def set_fans(fan_state) { } else { if (state.fansOn == true) { send("${app.label} fans Off.") - state.fansLastRunTime = (now() - state.fansOnTime) + //state.fansLastRunTime = (now() - state.fansOnTime) - BigInteger ms = new java.math.BigInteger(state.fansLastRunTime) - int seconds = (BigInteger) (((BigInteger) ms / (1000I)) % 60I) - int minutes = (BigInteger) (((BigInteger) ms / (1000I * 60I)) % 60I) - int hours = (BigInteger) (((BigInteger) ms / (1000I * 60I * 60I)) % 24I) - int days = (BigInteger) ((BigInteger) ms / (1000I * 60I * 60I * 24I)) + // BigInteger ms = new java.math.BigInteger(state.fansLastRunTime) + // int seconds = (BigInteger) (((BigInteger) ms / (1000I)) % 60I) + // int minutes = (BigInteger) (((BigInteger) ms / (1000I * 60I)) % 60I) + // int hours = (BigInteger) (((BigInteger) ms / (1000I * 60I * 60I)) % 24I) + // int days = (BigInteger) ((BigInteger) ms / (1000I * 60I * 60I * 24I)) - def sb = String.format("${app.label} cycle: %d:%02d:%02d:%02d", days, hours, minutes, seconds) + // def sb = String.format("${app.label} cycle: %d:%02d:%02d:%02d", days, hours, minutes, seconds) - send(sb) + // send(sb) - if (settings.fan_control_enabled) { + if (settings.fan_control_enabled) { fans.off() if (emeters) { log.debug emeters.currentValue('energy') -- 2.34.1