I'm using rc7 but I've never had any success with any version of auto format. However I seldom use it.
Can someone tell me or point to information on what I should expect from auto format?
I tried the below code expecting the autoformat to even out the indents but there was no change, I even selected all the code and Ctrl-T. = no change.
Am I missing something?
def illuminanceHandler(evt) {
LOGDEBUG("Running illuminance handler")
if(state.luxSendOK == true){
def ave = evt.value
def aveDev = evt.device
LOGDEBUG( "Received from: $aveDev - $ave")
def sum = 0
def count = 0
state.mean = 0
state.mean1 = 0
state.mean2 = 0
LOGDEBUG("sum = $sum")
for (sensor in settings.illumSensors) {
count += 1
LOGDEBUG( "Sensor data count = $count" )
sum += sensor.currentIlluminance }
LOGDEBUG( "Total Combined value = $sum")
state.mean1 = sum/count
state.mean2 = state.mean1.toFloat()
state.mean = state.mean2.round(state.DecimalPlaces)
LOGDEBUG("Average Illuminance = $state.mean")
def timeCheck1 = (60 * sendLuxInterval)
if(timeCheck1 == 0){ timeCheck1 = 5}
LOGDEBUG("Sending $state.mean to $vDevice then waiting $timeCheck1 seconds before I can send again")
settings.vDevice.setLux("${state.mean}")
settings.vDevice.lastDeviceLux("${aveDev}")
state.luxSendOK = false
// log.warn "timecheck1 = $timeCheck1"
runIn(timeCheck1, resetLuxNow) // , [overwrite: false])
}
else {
LOGDEBUG("Waiting for timer to expire")
}
}