Just doing 2 states for Thermostat:temporary patch.
authorrtrimana <rtrimana@uci.edu>
Tue, 6 Aug 2019 20:05:13 +0000 (13:05 -0700)
committerrtrimana <rtrimana@uci.edu>
Tue, 6 Aug 2019 20:05:13 +0000 (13:05 -0700)
Lock/Locks.groovy
Thermostat/Thermostats.groovy

index 626b244..e818888 100644 (file)
@@ -25,16 +25,16 @@ public class Locks{
                this.deviceNumbers = deviceNumbers
                this.locks = []
 
-               def init = Verify.getBoolean()
+               /*def init = Verify.getBoolean()
                if (init) {
                        this.lockState = "locked"
-                        this.currentLock = "locked"
-                        this.lockLatestValue = "locked"
+            this.currentLock = "locked"
+            this.lockLatestValue = "locked"
                } else {
                        this.lockState = "unlocked"
-                        this.currentLock = "unlocked"
-                        this.lockLatestValue = "unlocked"
-               }
+            this.currentLock = "unlocked"
+            this.lockLatestValue = "unlocked"
+               }*/
                locks.add(new Lock(sendEvent,id, label, displayName, this.lockState, this.lockLatestValue))
        }
 
index 59d6bca..c793fb9 100644 (file)
@@ -46,7 +46,7 @@ public class Thermostats{
                this.deviceNumbers = deviceNumbers
                this.thermostats = []
 
-               def initTemperature = Verify.getIntFromList(60, 66)
+               /*def initTemperature = Verify.getIntFromList(60, 66)
                this.temperature = initTemperature
                this.currentTemperature = initTemperature
                
@@ -100,6 +100,34 @@ public class Thermostats{
                        this.thermostatMode = "off"
                        this.currentThermostatMode = "off"
                        this.thermostatLatestMode = "off"
+               }*/
+               def init = Verify.getBoolean()
+               if (init) {
+                       this.temperature = 60
+                       this.currentTemperature = 60
+                       this.currentCoolingSetpoint = 70
+                       this.coolingSetpoint = 70
+                       this.currentHeatingSetpoint = 35
+                       this.heatingSetpoint = 35
+                       this.thermostatSetpoint = 50
+                       this.thermostatFanMode = "auto"
+                       this.thermostatLatestFanMode = "auto"
+                       this.thermostatMode = "auto"
+                       this.currentThermostatMode = "auto"
+                       this.thermostatLatestMode = "auto"
+               } else {
+                       this.temperature = 66
+                       this.currentTemperature = 66
+                       this.currentCoolingSetpoint = 80
+                       this.coolingSetpoint = 80
+                       this.currentHeatingSetpoint = 50
+                       this.heatingSetpoint = 50
+                       this.thermostatSetpoint = 60
+                       this.thermostatFanMode = "circulate"
+                       this.thermostatLatestFanMode = "circulate"
+                       this.thermostatMode = "off"
+                       this.currentThermostatMode = "off"
+                       this.thermostatLatestMode = "off"               
                }
 
                thermostats.add(new Thermostat(sendEvent, id, label, displayName, this.temperature, this.currentCoolingSetpoint,