X-Git-Url: http://plrg.eecs.uci.edu/git/?p=smartthings-infrastructure.git;a=blobdiff_plain;f=Event%2FEvent.groovy;fp=Event%2FEvent.groovy;h=1ef8f77d85b4399160a97ec9afb973d4b27336d7;hp=8c1d1c932bfcc4a1e9365e89349901996be578d1;hb=c3be64e00452e6b9789207f5746ab4089fcf1f0f;hpb=16ebbcf5da0fa9989acb5b03129b9706331066c5 diff --git a/Event/Event.groovy b/Event/Event.groovy index 8c1d1c9..1ef8f77 100644 --- a/Event/Event.groovy +++ b/Event/Event.groovy @@ -13,6 +13,7 @@ public class Event { private String unit private LinkedHashMap data private int integerValue + private List integerValues = ["battery", "hue", "saturation", "energy", "level", "temperature", "heatingSetpoint", "coolingSetpoint", "thermostatSetpoint"] Event(String value, String name, String deviceId, String descriptionText, boolean displayed, String linkText, String displayName, boolean isStateChange, String unit, LinkedHashMap data) { this.deviceId = deviceId @@ -25,7 +26,7 @@ public class Event { this.unit = unit this.data = data this.displayed = displayed - if (name == "battery") + if (integerValues.contains(name)) this.integerValue = value.toInteger() } }