mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-03-09 05:11:52 +00:00
Compare commits
4 Commits
PROD_2017.
...
MSA-1897-1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a68e64fb2c | ||
|
|
bcb92426ff | ||
|
|
e5739fd425 | ||
|
|
6448a5bc7c |
@@ -28,6 +28,7 @@ metadata {
|
||||
command "enrollResponse"
|
||||
|
||||
fingerprint inClusters: "0000, 0001, 0003, 0020, 0402, 0B05", outClusters: "0003, 0006, 0008, 0019", manufacturer: "OSRAM", model: "LIGHTIFY Dimming Switch", deviceJoinName: "OSRAM LIGHTIFY Dimming Switch"
|
||||
fingerprint inClusters: "0000, 0001, 0003, 0020, 0402, 0B05", outClusters: "0003, 0006, 0008, 0019", manufacturer: "CentraLite", model: "3130", deviceJoinName: "Centralite Zigbee Smart Switch"
|
||||
//fingerprint inClusters: "0000, 0001, 0003, 0020, 0500", outClusters: "0003,0019", manufacturer: "CentraLite", model: "3455-L", deviceJoinName: "Iris Care Pendant"
|
||||
fingerprint inClusters: "0000, 0001, 0003, 0007, 0020, 0402, 0B05", outClusters: "0003, 0006, 0019", manufacturer: "CentraLite", model: "3460-L", deviceJoinName: "Iris Smart Button"
|
||||
fingerprint inClusters: "0000, 0001, 0003, 0007, 0020, 0B05", outClusters: "0003, 0006, 0019", manufacturer: "CentraLite", model:"3450-L", deviceJoinName: "Iris KeyFob"
|
||||
@@ -251,12 +252,19 @@ def initialize() {
|
||||
if ((device.getDataValue("manufacturer") == "OSRAM") && (device.getDataValue("model") == "LIGHTIFY Dimming Switch")) {
|
||||
sendEvent(name: "numberOfButtons", value: 2)
|
||||
}
|
||||
else if ((device.getDataValue("manufacturer") == "CentraLite") &&
|
||||
((device.getDataValue("model") == "3455-L") || (device.getDataValue("model") == "3460-L"))) {
|
||||
sendEvent(name: "numberOfButtons", value: 1)
|
||||
}
|
||||
else if ((device.getDataValue("manufacturer") == "CentraLite") && (device.getDataValue("model") == "3450-L")) {
|
||||
sendEvent(name: "numberOfButtons", value: 4)
|
||||
else if (device.getDataValue("manufacturer") == "CentraLite") {
|
||||
if (device.getDataValue("model") == "3130") {
|
||||
sendEvent(name: "numberOfButtons", value: 2)
|
||||
}
|
||||
else if ((device.getDataValue("model") == "3455-L") || (device.getDataValue("model") == "3460-L")) {
|
||||
sendEvent(name: "numberOfButtons", value: 1)
|
||||
}
|
||||
else if (device.getDataValue("model") == "3450-L") {
|
||||
sendEvent(name: "numberOfButtons", value: 4)
|
||||
}
|
||||
else {
|
||||
sendEvent(name: "numberOfButtons", value: 4) //default case. can be changed later.
|
||||
}
|
||||
}
|
||||
else {
|
||||
//default. can be changed
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
import grails.converters.JSON
|
||||
|
||||
/**
|
||||
* JSON API Access App
|
||||
*/
|
||||
|
||||
definition(
|
||||
name: "Bling_SmartApps",
|
||||
namespace: "BlingSmartApps",
|
||||
author: "Bling",
|
||||
description: "Return things as JSON",
|
||||
category: "My Apps",
|
||||
iconUrl: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png",
|
||||
iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience@2x.png",
|
||||
oauth: [displayName: "JSON API", displayLink: ""]
|
||||
)
|
||||
|
||||
|
||||
preferences {
|
||||
section("Allow these things to be exposed via JSON...") {
|
||||
input "switches", "capability.switch", title: "Switches", multiple: true, required: true, hideWhenEmpty: true
|
||||
|
||||
//input "temperatures", "capability.temperatureMeasurement", title: "Temp Measurements", multiple: true, required: false
|
||||
//input "contacts", "capability.contactSensor", title: "Open/Closed Devices", multiple: true, required: false
|
||||
//input "presences", "capability.presenceSensor", title: "Presence Sensors", multiple: true, required: false
|
||||
//input "motions", "capability.motionSensor", title: "Motion Sensors", multiple: true, required: false
|
||||
}
|
||||
}
|
||||
|
||||
mappings {
|
||||
path("/things") {
|
||||
action: [
|
||||
GET: "listThings"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
def listThings() {
|
||||
[
|
||||
switches: switches.collect{device(it,"switch")}
|
||||
/*
|
||||
switches: switches.collect{device(it,"switch")},
|
||||
temperatures: temperatures.collect{device(it,"temperature")},
|
||||
contacts: contacts.collect{device(it,"contact")},
|
||||
presences: presences.collect{device(it,"presence")},
|
||||
motions: motions.collect{device(it,"motion")}
|
||||
*/
|
||||
]
|
||||
}
|
||||
|
||||
private device(it, type) {
|
||||
def device_state = [label:it.label, type:type, id:it.id, devtest:it]
|
||||
|
||||
for (attribute in it.supportedAttributes) {
|
||||
device_state."${attribute}" = it.currentValue("${attribute}")
|
||||
}
|
||||
|
||||
device_state ? device_state : null
|
||||
}
|
||||
|
||||
def installed() {}
|
||||
|
||||
def updated() {}
|
||||
|
||||
Reference in New Issue
Block a user