+ def auto() {
+ if (this.thermostatMode != "auto") {
+ this.thermostatLatestMode = "auto"
+ this.thermostatMode = "auto"
+ this.currentThermostatMode = "auto"
+ println("Mode of the thermostat with id:$id is changed to auto!")
+ sendEvent([name: "thermostatMode", value: "auto", deviceId: this.id, descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
+ }
+ }
+
+ def emergencyHeat() {
+ if (this.thermostatMode != "emergencyHeat") {
+ this.thermostatLatestMode = "emergencyHeat"
+ this.thermostatMode = "emergencyHeat"
+ this.currentThermostatMode = "emergencyHeat"
+ println("Mode of the thermostat with id:$id is changed to emergencyHeat!")
+ sendEvent([name: "thermostatMode", value: "emergencyHeat", deviceId: this.id, descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
+ }
+ }
+
+ def off() {
+ if (this.thermostatMode != "off") {
+ this.thermostatLatestMode = "off"
+ this.thermostatMode = "off"
+ this.currentThermostatMode = "off"
+ println("Mode of the thermostat with id:$id is changed to off!")
+ sendEvent([name: "thermostatMode", value: "off", deviceId: this.id, descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
+ }
+ }
+
+ def setClimate(String info, String givenClimateName) {
+ if (this.climateName != givenClimateName) {
+ this.climateName = givenClimateName
+ println("Climate name of the thermostat with id:$id is changed to $givenClimateName!")
+ }
+ }
+
+ def setHold(String info1, int coolingSetpoint, int heatingSetpoint, String info2, String info3) {
+ if ((this.heatingSetpoint != heatingSetpoint) || (this.coolingSetpoint != coolingSetpoint)) {
+ this.coolingSetpoint = coolingSetpoint
+ this.currentCoolingSetpoint = currentCoolingSetpoint
+ println("Cooling set point for the thermostat with id:$id is changed to $coolingSetpoint!")
+ this.heatingSetpoint = heatingSetpoint
+ this.currentHeatingSetpoint = currentHeatingSetpoint
+ 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"}'])
+ sendEvent([name: "coolingSetpoint", value: "$coolingSetpoint", deviceId: this.id, descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
+ }
+ }