package RelativeHumidityMeasurement
import SmartThing.SmartThing
-//Importing mutable integer class
-import MutableInteger.MutableInteger
-
public class RelativeHumidityMeasurement extends SmartThing {
// id, label, and display name of the device
- StringBuilder id = new StringBuilder()
- StringBuilder label = new StringBuilder()
- StringBuilder displayName = new StringBuilder()
- // Features with numberical values
- MutableInteger currentHumidity = new MutableInteger()
+ String id
+ String label
+ String displayName
// Maps from features to values
- HashMap<String, MutableInteger> deviceIntValuesMap = new HashMap<String, MutableInteger>()
+ HashMap<String, Integer> deviceIntValuesMap = new HashMap<String, Integer>()
- RelativeHumidityMeasurement(Closure sendEvent, StringBuilder id, StringBuilder label, StringBuilder displayName, MutableInteger currentHumidity) {
- deviceIntValuesMap = deviceIntValueSmartThing
+ RelativeHumidityMeasurement(Closure sendEvent, String id, String label, String displayName, Integer currentHumidity) {
+ deviceIntValueSmartThing = deviceIntValuesMap
idSmartThing = id
labelSmartThing = label
displayNameSmartThing = displayName
this.id = id
this.label = label
this.displayName = displayName
- this.currentHumidity = currentHumidity
deviceIntValuesMap.put("humidity", currentHumidity)
}
-
- // Methods to return values
- def getCurrentHumidity() {
- return currentHumidity.getValue()
- }
}