From 023ca77d5250fa85dc446f50f570c336121e69ab Mon Sep 17 00:00:00 2001 From: Abraham Tehrani Date: Tue, 19 May 2020 14:30:02 -0700 Subject: [PATCH] Fix for #6 --- .../4-speed-ceiling-fan-thermostat-zigbee.groovy | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/smartapps/dcoffing/4-speed-ceiling-fan-thermostat-zigbee.src/4-speed-ceiling-fan-thermostat-zigbee.groovy b/smartapps/dcoffing/4-speed-ceiling-fan-thermostat-zigbee.src/4-speed-ceiling-fan-thermostat-zigbee.groovy index 77fd113..f7f93f2 100644 --- a/smartapps/dcoffing/4-speed-ceiling-fan-thermostat-zigbee.src/4-speed-ceiling-fan-thermostat-zigbee.groovy +++ b/smartapps/dcoffing/4-speed-ceiling-fan-thermostat-zigbee.src/4-speed-ceiling-fan-thermostat-zigbee.groovy @@ -273,8 +273,8 @@ private tempCheck(currentTemp, desiredTemp) private hasBeenRecentMotion() { def isActive = false - if (motionSensor && minutes) { - def deltaMinutes = minutes as Long + if (motionSensor && minutesNoMotion) { + def deltaMinutes = minutesNoMotion as Long if (deltaMinutes) { def motionEvents = motionSensor.eventsSince(new Date(now() - (60000 * deltaMinutes))) log.trace "Found ${motionEvents?.size() ?: 0} events in the last $deltaMinutes minutes" @@ -309,4 +309,4 @@ private def textHelp() { " in the Hampton Bay Wink Ceiling Fan MR101Z receiver in the Gardinier 52' Ceiling Fan or"+ " Universal Ceiling Fan Premier Remote from Home Depot." - } \ No newline at end of file + }