private String id = "temperatureMeasurementID0"
private String label = "temperatureMeasurement0"
private String displayName = "temperatureMeasurement0"
- private int temperature = 50
- private int currentTemperature = 50
+ private int temperature = 40
+ private int currentTemperature = 40
TemperatureMeasurements(Closure sendEvent, int deviceNumbers, boolean init) {
this.sendEvent = sendEvent
this.temperatureMeasurements = []
if (init) {
- this.temperature = 50
- this.currentTemperature = 50
+ this.temperature = 40
+ this.currentTemperature = 40
} else {
this.temperature = 60
this.currentTemperature = 60
this.thermostatMode = "cool"
this.currentThermostatMode = "cool"
println("Mode of the thermostat with id:$id is changed to cool!")
- sendEvent([name: "cool", value: "cool", deviceId: this.id, descriptionText: "",
+ sendEvent([name: "thermostatMode", value: "cool", deviceId: this.id, descriptionText: "",
displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
}
}
this.thermostatMode = "heat"
this.currentThermostatMode = "heat"
println("Mode of the thermostat with id:$id is changed to heat!")
- sendEvent([name: "heat", value: "heat", deviceId: this.id, descriptionText: "",
+ sendEvent([name: "thermostatMode", value: "heat", deviceId: this.id, descriptionText: "",
displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
}
}
this.thermostatMode = "auto"
this.currentThermostatMode = "auto"
println("Mode of the thermostat with id:$id is changed to auto!")
- sendEvent([name: "auto", value: "auto", deviceId: this.id, descriptionText: "",
+ 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"}'])
}
}
this.thermostatMode = "off"
this.currentThermostatMode = "off"
println("Mode of the thermostat with id:$id is changed to off!")
- sendEvent([name: "off", value: "off", deviceId: this.id, descriptionText: "",
+ sendEvent([name: "thermostatMode", value: "off", deviceId: this.id, descriptionText: "",
displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
}
}