this.color = "green"
} else {
this.color = "blue"
- }
+ }*/
- colorControls.add(new ColorControl(id, label, displayName, this.color, this.hue, this.saturation))
+ colorControls.add(new ColorControl(id, label, displayName, this.color, this.hue, this.saturation, this.level, this.currentSwitch, this.colorTemperature))
}
//Methods for closures
def lock() {
if (lockState != "locked") {
println("the door with id:$id is locked!")
++<<<<<<< HEAD
++=======
+ //this.lockLatestValue = this.lockState
++>>>>>>> a02c9807815a35c0f57241ee6510a3d312499049
this.lockLatestValue = "locked"
this.lockState = "locked"
this.currentLock = "locked"
if (lockState != "locked") {
def task = timers.runAfter(metaData["delay"]) {
println("the door with id:$id is locked!")
++<<<<<<< HEAD
++=======
+ //this.lockLatestValue = this.lockState
++>>>>>>> a02c9807815a35c0f57241ee6510a3d312499049
this.lockLatestValue = "locked"
this.lockState = "locked"
this.currentLock = "locked"
def unlock() {
if (lockState != "unlocked") {
println("the door with id:$id is unlocked!")
++<<<<<<< HEAD
++=======
+ //this.lockLatestValue = this.lockState
++>>>>>>> a02c9807815a35c0f57241ee6510a3d312499049
this.lockLatestValue = "unlocked"
this.lockState = "unlocked"
this.currentLock = "unlocked"
displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
sendEvent([name: "lock", value: "unlocked", deviceId: this.id, descriptionText: "",
displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
++<<<<<<< HEAD
+ sendEvent([name: "lock.unlocked", value: "unlocked", deviceId: this.id, descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
++=======
++>>>>>>> a02c9807815a35c0f57241ee6510a3d312499049
}
}
if (lockState != "unlocked") {
def task = timers.runAfter(metaData["delay"]) {
println("the door with id:$id is locked!")
++<<<<<<< HEAD
+ this.lockLatestValue = "unlocked"
+ this.lockState = "unlocked"
+ this.currentLock = "unlocked"
+ sendEvent([name: "unlock", value: "unlocked", deviceId: this.id, descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
+ sendEvent([name: "lock", value: "unlocked", deviceId: this.id, descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
+ sendEvent([name: "lock.unlocked", value: "unlocked", deviceId: this.id, descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
++=======
+ //this.lockLatestValue = this.lockState
+ this.lockLatestValue = "locked"
+ this.lockState = "locked"
+ this.currentLock = "locked"
+ sendEvent([name: "unlock", value: "unlocked", deviceId: this.id, descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
+ sendEvent([name: "lock", value: "unlocked", deviceId: this.id, descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
++>>>>>>> a02c9807815a35c0f57241ee6510a3d312499049
}
}
}
if (initMute) {
this.mute = "unmuted"
} else {
- this.mute = "mute"
+ this.mute = "muted"
}
- def initStatus = Verify.getBoolean()
- if (initStatus) {
+ def initStatus = Verify.getInt(0,2)
+ if (initStatus == 0) {
this.status = "paused"
- } else {
+ } else if (initStatus == 1) {
this.status = "playing"
+ } else {
+ this.status = "stopped"
}
++<<<<<<< HEAD
+
++=======
+ def initTrack = Verify.getIntFromList(1, 2, 3)
+ this.trackNumber = initTrack
+ def initData = Verify.getBoolean()
+ if (initData) {
+ this.trackData = "someTrack"
+ } else {
+ this.trackData = "someOtherTrack"
+ }
+ def initDesc = Verify.getBoolean()
+ if (initDesc) {
+ this.trackDescription = "someDescriptions"
+ } else {
+ this.trackDescription = "someOtherDescriptions"
+ }*/
++>>>>>>> a02c9807815a35c0f57241ee6510a3d312499049
musicPlayers.add(new MusicPlayer(sendEvent, id, label, displayName, this.level, this.mute, this.status, this.trackNumber, this.trackData, this.trackDescription))
}
this.deviceNumbers = deviceNumbers
this.smokeDetectors = []
++<<<<<<< HEAD
+ def initBattery = Verify.getIntFromList(30, 50, 70)
+ this.battery = initBattery
+ this.batteryLatestValue = initBattery
+
+ def initSmoke = Verify.getInt(0,2)
+ if (initSmoke == 0) {
++=======
+ /*def init = Verify.getInt(0,2)
+ if (init == 0) {
++>>>>>>> a02c9807815a35c0f57241ee6510a3d312499049
this.currentSmokeValue = "clear"
this.smokeLatestValue = "clear"
- } else if (init == 1) {
+ } else if (initSmoke == 1) {
this.currentSmokeValue = "detected"
this.smokeLatestValue = "detected"
} else {
this.currentSmokeValue = "tested"
this.smokeLatestValue = "tested"
++<<<<<<< HEAD
+ }
+
+ def initCarbonMonoxide = Verify.getInt(0,2)
+ if (initCarbonMonoxide == 0) {
+ this.currentCarbonMonoxideValue = "clear"
+ this.carbonMonoxideLatestValue = "clear"
+ } else if (initCarbonMonoxide == 1) {
+ this.currentCarbonMonoxideValue = "detected"
+ this.carbonMonoxideLatestValue = "detected"
+ } else {
+ this.currentCarbonMonoxideValue = "tested"
+ this.carbonMonoxideLatestValue = "tested"
+ }
+ smokeDetectors.add(new SmokeDetector(id, label, displayName, this.currentSmokeValue, this.smokeLatestValue, this.currentCarbonMonoxideValue,
+ this.carbonMonoxideLatestValue, this.battery))
++=======
+ }*/
+ smokeDetectors.add(new SmokeDetector(id, label, displayName, this.currentSmokeValue, this.smokeLatestValue))
++>>>>>>> a02c9807815a35c0f57241ee6510a3d312499049
}
//By Model Checker
private String label = "temperatureMeasurement0"
private String displayName = "temperatureMeasurement0"
private int temperature = 50
++<<<<<<< HEAD
+ private int currentTemperature = 50
+
++=======
++>>>>>>> a02c9807815a35c0f57241ee6510a3d312499049
-
-
TemperatureMeasurements(Closure sendEvent, int deviceNumbers) {
this.sendEvent = sendEvent
this.deviceNumbers = deviceNumbers
this.deviceNumbers = deviceNumbers
this.thermostats = []
- def initTemperature = Verify.getIntFromList(60, 66, 70)
+ /*def initTemperature = Verify.getIntFromList(60, 66, 70)
this.temperature = initTemperature
+ this.currentTemperature = initTemperature
def initCoolingSetpoint = Verify.getIntFromList(70, 80, 90)
this.currentCoolingSetpoint = initCoolingSetpoint
} else {
this.thermostatMode = "off"
this.currentThermostatMode = "off"
++<<<<<<< HEAD
+ this.thermostatLatestMode = "off"
+ }
++=======
+ }*/
++>>>>>>> a02c9807815a35c0f57241ee6510a3d312499049
thermostats.add(new Thermostat(sendEvent, id, label, displayName, this.temperature, this.currentCoolingSetpoint,
this.currentHeatingSetpoint, this.coolingSetpoint, this.thermostatSetpoint, this.heatingSetpoint, this.coolingSetpointRange,
case 0:
def event = Verify.getInt(0,1)
if (event == 0) {
++<<<<<<< HEAD
+ switchObject.setValue([name: "switch", value: "on", deviceId: "switchID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
+ } else {
+ switchObject.setValue([name: "switch", value: "off", deviceId: "switchID0", descriptionText: "",
++=======
+ lockObject.setValue([name: "lock", value: "locked", deviceId: "lockID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}']) } else {
+ lockObject.setValue([name: "lock", value: "unlocked", deviceId: "lockID0", descriptionText: "",
++>>>>>>> a02c9807815a35c0f57241ee6510a3d312499049
displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
}
break
displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
break
case 4:
++<<<<<<< HEAD
+ break
+ case 5:
++=======
+ appObject.setValue([name: "Touched", value: "touched", deviceId: "touchedSensorID0", descriptionText: "",
+ displayed: true, linkText: "", isStateChange: false, unit: "", data: '{"info": "info"}'])
++>>>>>>> a02c9807815a35c0f57241ee6510a3d312499049
break
}
}