-
- 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 light with id:$id 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 of the light with id:$id 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 getCurrentHue() {
- return currentHue.getValue()
- }
-
- def getCurrentSaturation() {
- return currentSaturation.getValue()
- }
-
- def getCurrentColor() {
- return currentColor.toString()
- }