-
- def action(StringBuilder variable, String newValue, String feature) {
- if (!variable.toString().equals(newValue)) {
- String tmpID = id.toString()
- variable.replace(0, variable.length(), newValue)
- println("$feature of the thermostat with id:$tmpID is changed to $newValue!")
- sendEvent([name: feature, value: newValue, deviceId: tmpID, descriptionText: "",
- displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
- }
- }
-
- def action(MutableInteger variable, int newValue, String feature) {
- if (!variable.getValue().equals(newValue)) {
- String tmpID = id.toString()
- variable.setValue(newValue)
- println("$feature for the thermostat with id:$tmpID is changed to $newValue!")
- sendEvent([name: feature, value: newValue, deviceId: tmpID, descriptionText: "",
- displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
- }
- }
-
- // Methods to return values
- def getCurrentTemperature() {
- return currentTemperature.getValue()
- }
-
- def getCurrentCoolingSetpoint() {
- return currentCoolingSetpoint.getValue()
- }
-
- def getCurrentHeatingSetpoint() {
- return currentHeatingSetpoint.getValue()
- }
-
- def getCurrentThermostatSetPoint() {
- return currentThermostatSetPoint.getValue()
- }
-
- def getCurrentThermostatOperatingState() {
- return currentThermostatOperatingState.toString()
- }
-
- def getCurrentThermostatFanMode() {
- return currentThermostatFanMode.toString()
- }
-
- def getCurrentThermostatMode() {
- return currentThermostatMode.toString()
- }
-
- def getCurrentClimateName() {
- return currentClimateName.toString()
- }