1 //Create a class for battery
3 import Timer.SimulatedTimer
8 private String displayName
10 private int currentBattery
12 Battery(String id, String label, String displayName, int battery) {
15 this.displayName = displayName
16 this.battery = battery
17 this.currentBattery = battery
21 def setValue(String value) {
22 println("the battery level with id:$id is changed to $value!")
23 this.battery = value.toInteger()
24 this.currentBattery = value.toInteger()
27 def currentValue(String deviceFeature) {
28 if (deviceFeature == "battery") {