1 //Create a class for relative humidity measurement
2 package RelativeHumidityMeasurement
3 import Timer.SimulatedTimer
5 public class RelativeHumidityMeasurement {
8 private String displayName
10 private int currentHumidity
12 RelativeHumidityMeasurement(String id, String label, String displayName, int humidity) {
15 this.displayName = displayName
16 this.humidity = humidity
20 def setValue(String value) {
21 println("the humidity is changed to $value!")
22 this.humidity = value.toInteger()
23 this.currentHumidity = value.toInteger()
26 def currentValue(String deviceFeature) {
27 if (deviceFeature == "humidity") {
32 def latestValue(String deviceFeature) {
33 if (deviceFeature == "humidity") {