1 //Create a class for illuminance measurement
2 package IlluminanceMeasurement
3 import Timer.SimulatedTimer
5 public class IlluminanceMeasurement {
8 private String displayName
9 private int illuminance
10 private int currentIlluminance
12 IlluminanceMeasurement(String id, String label, String displayName, int illuminance) {
15 this.displayName = displayName
16 this.illuminance = illuminance
17 this.currentIlluminance = illuminance
21 def setValue(String value) {
22 println("the illuminance level is changed to $value!")
23 this.illuminance = value.toInteger()
24 this.currentIlluminance = value.toInteger()
27 def currentValue(String deviceFeature) {
28 if (deviceFeature == "illuminance") {
33 def latestValue(String deviceFeature) {
34 if (deviceFeature == "illuminance") {