- //By Model Checker
- def setValue(String value) {
- println("the door with id:$id is $value!")
- this.lockLatestValue = value
- this.lockState = value
- this.currentLock = value
- }
-
- def currentValue(String deviceFeature) {
- if (deviceFeature == "lock") {
- return lockState
+ def action(StringBuilder variable, String newValue) {
+ if (!variable.toString().equals(newValue)) {
+ String tmpID = id.toString()
+ variable.replace(0, variable.length(), newValue)
+ println("Lock with id:$tmpID is changed to $newValue!")
+ sendEvent([name: "lock", value: newValue, deviceId: tmpID, descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])