Merge pull request #2005 from SmartThingsCommunity/staging

Rolling up staging to production
This commit is contained in:
Vinay Rao
2017-05-16 14:37:45 -07:00
committed by GitHub
5 changed files with 20 additions and 10 deletions

View File

@@ -103,7 +103,7 @@ metadata {
} }
valueTile("illuminance", "device.illuminance", inactiveLabel: false, width: 2, height: 2) { valueTile("illuminance", "device.illuminance", inactiveLabel: false, width: 2, height: 2) {
state "illuminance", label:'${currentValue} ${unit}', unit:"lux" state "illuminance", label:'${currentValue} lux', unit:""
} }
valueTile("ultravioletIndex", "device.ultravioletIndex", inactiveLabel: false, width: 2, height: 2) { valueTile("ultravioletIndex", "device.ultravioletIndex", inactiveLabel: false, width: 2, height: 2) {
@@ -410,4 +410,4 @@ private command(physicalgraph.zwave.Command cmd) {
private commands(commands, delay=200) { private commands(commands, delay=200) {
log.info "sending commands: ${commands}" log.info "sending commands: ${commands}"
delayBetween(commands.collect{ command(it) }, delay) delayBetween(commands.collect{ command(it) }, delay)
} }

View File

@@ -86,7 +86,7 @@ metadata {
state "humidity", label:'${currentValue}% humidity', unit:"" state "humidity", label:'${currentValue}% humidity', unit:""
} }
valueTile("illuminance", "device.illuminance", inactiveLabel: false, width: 2, height: 2) { valueTile("illuminance", "device.illuminance", inactiveLabel: false, width: 2, height: 2) {
state "luminosity", label:'${currentValue} ${unit}', unit:"lux" state "luminosity", label:'${currentValue} lux', unit:""
} }
valueTile("battery", "device.battery", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { valueTile("battery", "device.battery", inactiveLabel: false, decoration: "flat", width: 2, height: 2) {
state "battery", label:'${currentValue}% battery', unit:"" state "battery", label:'${currentValue}% battery', unit:""
@@ -282,5 +282,4 @@ private secure(physicalgraph.zwave.Command cmd) {
private secureSequence(commands, delay=200) { private secureSequence(commands, delay=200) {
delayBetween(commands.collect{ secure(it) }, delay) delayBetween(commands.collect{ secure(it) }, delay)
} }

View File

@@ -79,7 +79,7 @@ metadata {
state "humidity", label:'${currentValue}% humidity', unit:"" state "humidity", label:'${currentValue}% humidity', unit:""
} }
valueTile("illuminance", "device.illuminance", inactiveLabel: false, width: 2, height: 2) { valueTile("illuminance", "device.illuminance", inactiveLabel: false, width: 2, height: 2) {
state "luminosity", label:'${currentValue} ${unit}', unit:"lux" state "luminosity", label:'${currentValue} lux', unit:""
} }
valueTile("battery", "device.battery", inactiveLabel: false, decoration: "flat", width: 2, height: 2) { valueTile("battery", "device.battery", inactiveLabel: false, decoration: "flat", width: 2, height: 2) {
state "battery", label:'${currentValue}% battery', unit:"" state "battery", label:'${currentValue}% battery', unit:""
@@ -193,4 +193,4 @@ def configure() {
// set data reporting period to 5 minutes // set data reporting period to 5 minutes
zwave.configurationV1.configurationSet(parameterNumber: 111, size: 4, scaledConfigurationValue: 300).format() zwave.configurationV1.configurationSet(parameterNumber: 111, size: 4, scaledConfigurationValue: 300).format()
]) ])
} }

View File

@@ -765,7 +765,6 @@ def turnOffSwitch() {
} else { } else {
device.off(); device.off();
return [Device_id: params.id, result_action: "200"] return [Device_id: params.id, result_action: "200"]
} }
} }
@@ -789,6 +788,7 @@ def getTempSensorsStatus(id) {
return [] return []
} else { } else {
def bat = getBatteryStatus(device.id) def bat = getBatteryStatus(device.id)
return [temperature: device.currentValue('temperature')] + bat def scale = [Scale: location.temperatureScale]
return [temperature: device.currentValue('temperature')] + bat + scale
} }
} }

View File

@@ -162,6 +162,17 @@ def registerAllDeviceSubscriptions() {
registerChangeHandler(inputs) registerChangeHandler(inputs)
} }
//Subscribe to events from a list of devices
def registerChangeHandler(myList) {
myList.each { myDevice ->
def theAtts = myDevice.supportedAttributes
theAtts.each { att ->
subscribe(myDevice, att.name, deviceEventHandler)
log.info "Registering for ${myDevice.displayName}.${att.name}"
}
}
}
//Endpoints function: Subscribe to events from a specific device //Endpoints function: Subscribe to events from a specific device
def registerDeviceChange() { def registerDeviceChange() {
def subscriptionEndpt = params.subscriptionURL def subscriptionEndpt = params.subscriptionURL