Infrastructure that works for all the locks' group!
[smartthings-infrastructure.git] / EnergyMeter / EnergyMeter.groovy
index 0274eefd4a7d666d6b5b4c6b18fc3230ed944345..a0ab13ea73c4363e6743b9347686f7fcb07ac9ff 100644 (file)
@@ -6,9 +6,10 @@ public class EnergyMeter {
        private String id
        private String label
        private String displayName
        private String id
        private String label
        private String displayName
-       private String energy
+       private int energy
+       private int currentEnergy
 
 
-       EnergyMeter(String id, String label, String displayName, String energy) {
+       EnergyMeter(String id, String label, String displayName, int energy) {
                this.id = id
                this.label = label
                this.displayName = displayName
                this.id = id
                this.label = label
                this.displayName = displayName
@@ -18,8 +19,8 @@ public class EnergyMeter {
        //By Model Checker
        def setValue(String value) {
                println("the enery is changed to $value!")
        //By Model Checker
        def setValue(String value) {
                println("the enery is changed to $value!")
-               this.battery = value.toInteger()
-               this.currentBattery = value.toInteger()
+               this.energy = value.toInteger()
+               this.currentEnergy = value.toInteger()
        }
 
        def currentValue(String deviceFeature) {
        }
 
        def currentValue(String deviceFeature) {