@Field boolVariable4
@Field boolVariable5
-
-
/////Input Methods/////
//input "",""
def input(String name, String type) {
println "Options: "+metaData['options']
}
def contains = 0
+ // Return if this capability has been instantiated
+ //if (metaData['type'].startsWith("device") || metaData['type'].startsWith("capability")) {
+ // if (capabilitySet.contains(metaData['type'])) {
+ // return
+ // } else {
+ // capabilitySet.add(metaData['type'])
+ // }
+ //}
switch(metaData['type']) {
case "capability.lock":
globalObjects.eachLine { line ->
- if(line.contains('"lockObject"')){
+ if(line.contains("lockObject")){
contains = 1
- }
+ }
}
if (contains == 0)
break
case "capability.alarm":
globalObjects.eachLine { line ->
- if(line.contains('"alarmObject"')){
+ if(line.contains("alarmObject")){
contains = 1
}
}
break
case "capability.battery":
globalObjects.eachLine { line ->
- if(line.contains('"batteryObject"')){
+ if(line.contains("batteryObject")){
contains = 1
}
}
break
case "capability.beacon":
globalObjects.eachLine { line ->
- if(line.contains('"beaconSensorObject"')){
+ if(line.contains("beaconSensorObject")){
contains = 1
}
}
break
case "capability.carbonMonoxideDetector":
globalObjects.eachLine { line ->
- if(line.contains('"carbonMonoxideDetectorObject"')){
+ if(line.contains("carbonMonoxideDetectorObject")){
contains = 1
}
}
break
case "capability.colorControl":
globalObjects.eachLine { line ->
- if(line.contains('"colorControlObject"')){
+ if(line.contains("colorControlObject")){
contains = 1
}
}
break
case "capability.contactSensor":
globalObjects.eachLine { line ->
- if(line.contains('"contactObject"')){
+ if(line.contains("contactObject")){
contains = 1
}
}
break
case "capability.doorControl":
globalObjects.eachLine { line ->
- if(line.contains('"doorControlObject"')){
+ if(line.contains("doorControlObject")){
contains = 1
}
}
break
case "capability.energyMeter":
globalObjects.eachLine { line ->
- if(line.contains('"energyMeterObject"')){
+ if(line.contains("energyMeterObject")){
contains = 1
}
}
break
case "capability.illuminanceMeasurement":
globalObjects.eachLine { line ->
- if(line.contains('"illuminanceMeasurementObject"')){
+ if(line.contains("illuminanceMeasurementObject")){
contains = 1
}
}
break
case "capability.accelerationSensor":
globalObjects.eachLine { line ->
- if(line.contains('"accelerationSensorObject"')){
+ if(line.contains("accelerationSensorObject")){
contains = 1
}
}
break
case "capability.motionSensor":
globalObjects.eachLine { line ->
- if(line.contains('"motionSensorObject"')){
+ if(line.contains("motionSensorObject")){
contains = 1
}
}
break
case "capability.musicPlayer":
globalObjects.eachLine { line ->
- if(line.contains('"musicPlayerObject"')){
+ if(line.contains("musicPlayerObject")){
contains = 1
}
}
break
case "capability.powerMeter":
globalObjects.eachLine { line ->
- if(line.contains('"powerMeterObject"')){
+ if(line.contains("powerMeterObject")){
contains = 1
}
}
break
case "capability.presenceSensor":
globalObjects.eachLine { line ->
- if(line.contains('"presenceSensorObject"')){
+ if(line.contains("presenceSensorObject")){
contains = 1
}
}
break
case "capability.relativeHumidityMeasurement":
globalObjects.eachLine { line ->
- if(line.contains('"humidityMeasurementObject"')){
+ if(line.contains("humidityMeasurementObject")){
contains = 1
}
}
break
case "capability.relaySwitch":
globalObjects.eachLine { line ->
- if(line.contains('"relaySwitchObject"')){
+ if(line.contains("relaySwitchObject")){
contains = 1
}
}
break
case "capability.sleepSensor":
globalObjects.eachLine { line ->
- if(line.contains('"sleepSensorObject"')){
+ if(line.contains("sleepSensorObject")){
contains = 1
}
}
break
case "capability.smokeDetector":
globalObjects.eachLine { line ->
- if(line.contains('"smokeDetectorObject"')){
+ if(line.contains("smokeDetectorObject")){
contains = 1
}
}
break
case "capability.stepSensor":
globalObjects.eachLine { line ->
- if(line.contains('"stepSensorObject"')){
+ if(line.contains("stepSensorObject")){
contains = 1
}
}
break
case "capability.switch":
globalObjects.eachLine { line ->
- if(line.contains('"switchObject"')){
+ if(line.contains("switchObject")){
contains = 1
}
}
break
case "capability.switchLevel":
globalObjects.eachLine { line ->
- if(line.contains('"switchLevelObject"')){
+ if(line.contains("switchLevelObject")){
contains = 1
}
}
break
case "capability.temperatureMeasurement":
globalObjects.eachLine { line ->
- if(line.contains('"temperatureMeasurementObject"')){
+ if(line.contains("temperatureMeasurementObject")){
contains = 1
}
}
break
case "capability.thermostat":
globalObjects.eachLine { line ->
- if(line.contains('thermostatObject')){
+ if(line.contains("thermostatObject")){
contains = 1
}
}
break
case "capability.valve":
globalObjects.eachLine { line ->
- if(line.contains('"valveObject"')){
+ if(line.contains("valveObject")){
contains = 1
}
}
break
case "capability.speechSynthesis":
globalObjects.eachLine { line ->
- if(line.contains('"speechSynthesisObject"')){
+ if(line.contains("speechSynthesisObject")){
contains = 1
}
}
break
case "capability.waterSensor":
globalObjects.eachLine { line ->
- if(line.contains('"waterSensorObject"')){
+ if(line.contains("waterSensorObject")){
contains = 1
}
}
break
case "capability.touchSensor":
globalObjects.eachLine { line ->
- if(line.contains('"touchSensorObject"')){
+ if(line.contains("touchSensorObject")){
contains = 1
}
}
break
case "capability.imageCapture":
contains = globalObjects.eachLine { line ->
- if(line.contains('"imageCaptureObject"')){
+ if(line.contains("imageCaptureObject")){
contains = 1
}
}
break
case "device.mobilePresence":
contains = globalObjects.eachLine { line ->
- if(line.contains('"mobilePresenceObject"')){
+ if(line.contains("mobilePresenceObject")){
contains = 1
}
}
break
case "device.aeonKeyFob":
contains = globalObjects.eachLine { line ->
- if(line.contains('"aeonKeyFobObject"')){
+ if(line.contains("aeonKeyFobObject")){
contains = 1
}
}