A bug in Thermostat group
[smartthings-infrastructure.git] / Thermostat / Thermostat.groovy
index b758a4ace45fa8671286c0d548a4f66313a53cae..41a351cd2470043f10445ba3d10787c18649b8f4 100644 (file)
@@ -72,7 +72,7 @@ public class Thermostat {
                if (this.coolingSetpoint != coolingSetpoint) {
                        this.latestCoolingSetPoint = coolingSetpoint
                        this.coolingSetpoint = coolingSetpoint
                if (this.coolingSetpoint != coolingSetpoint) {
                        this.latestCoolingSetPoint = coolingSetpoint
                        this.coolingSetpoint = coolingSetpoint
-                       this.currentCoolingSetpoint = currentCoolingSetpoint
+                       this.currentCoolingSetpoint = coolingSetpoint
                        println("Cooling set point for the thermostat with id:$id is changed to $coolingSetpoint!")
                        sendEvent([name: "coolingSetpoint", value: "$coolingSetpoint", deviceId: this.id, descriptionText: "",
                                   displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
                        println("Cooling set point for the thermostat with id:$id is changed to $coolingSetpoint!")
                        sendEvent([name: "coolingSetpoint", value: "$coolingSetpoint", deviceId: this.id, descriptionText: "",
                                   displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
@@ -87,7 +87,7 @@ public class Thermostat {
                if (this.heatingSetpoint != heatingSetpoint) {
                        this.latestHeatingSetPoint = heatingSetpoint
                        this.heatingSetpoint = heatingSetpoint
                if (this.heatingSetpoint != heatingSetpoint) {
                        this.latestHeatingSetPoint = heatingSetpoint
                        this.heatingSetpoint = heatingSetpoint
-                       this.currentHeatingSetpoint = currentHeatingSetpoint
+                       this.currentHeatingSetpoint = heatingSetpoint
                        println("Heating set point for the thermostat with id:$id is changed to $heatingSetpoint!")
                        sendEvent([name: "heatingSetpoint", value: "$heatingSetpoint", deviceId: this.id, descriptionText: "",
                                   displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
                        println("Heating set point for the thermostat with id:$id is changed to $heatingSetpoint!")
                        sendEvent([name: "heatingSetpoint", value: "$heatingSetpoint", deviceId: this.id, descriptionText: "",
                                   displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
@@ -116,7 +116,7 @@ public class Thermostat {
                if (this.thermostatMode != thermostatMode) {
                        this.thermostatLatestMode =thermostatMode
                        this.thermostatMode = thermostatMode
                if (this.thermostatMode != thermostatMode) {
                        this.thermostatLatestMode =thermostatMode
                        this.thermostatMode = thermostatMode
-                       this.currentThermostatMode = currentThermostatMode
+                       this.currentThermostatMode = thermostatMode
                        println("Mode of the thermostat with id:$id is changed to $thermostatMode!")
                        sendEvent([name: "thermostatMode", value: "$thermostatMode", deviceId: this.id, descriptionText: "",
                                   displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
                        println("Mode of the thermostat with id:$id is changed to $thermostatMode!")
                        sendEvent([name: "thermostatMode", value: "$thermostatMode", deviceId: this.id, descriptionText: "",
                                   displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])