From 623a748241a41d3ce50183188ca0c3a22e779cb2 Mon Sep 17 00:00:00 2001 From: rtrimana Date: Thu, 1 Aug 2019 12:25:05 -0700 Subject: [PATCH 1/1] Fixing a bug in ContactSensor. --- ContactSensor/ContactSensor.groovy | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ContactSensor/ContactSensor.groovy b/ContactSensor/ContactSensor.groovy index b4ed629..141faf2 100644 --- a/ContactSensor/ContactSensor.groovy +++ b/ContactSensor/ContactSensor.groovy @@ -29,11 +29,11 @@ public class ContactSensor { this.contactState = value this.currentContact = value this.latestValue = value - this.events.add(eventDataMap) - this.timeOfEvents.add(System.currentTimeMillis()) + //this.events.add(eventDataMap) + //this.timeOfEvents.add(System.currentTimeMillis()) } - def eventsSince(Date dateObj) { + /*def eventsSince(Date dateObj) { def List happenedEvents = [] def sinceThen = dateObj.time for (int i = 0;i < timeOfEvents.size();i++) { @@ -41,7 +41,7 @@ public class ContactSensor { happenedEvents.add(events[i]) } return happenedEvents - } + }*/ def on() { println("the contact sensor with id:$id is armed!") -- 2.34.1