mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-03-19 13:20:53 +00:00
Compare commits
3 Commits
PROD_2017.
...
MSA-1898-1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3ffa7b4712 | ||
|
|
e5739fd425 | ||
|
|
6448a5bc7c |
@@ -28,6 +28,7 @@ metadata {
|
|||||||
command "enrollResponse"
|
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: "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, 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, 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"
|
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")) {
|
if ((device.getDataValue("manufacturer") == "OSRAM") && (device.getDataValue("model") == "LIGHTIFY Dimming Switch")) {
|
||||||
sendEvent(name: "numberOfButtons", value: 2)
|
sendEvent(name: "numberOfButtons", value: 2)
|
||||||
}
|
}
|
||||||
else if ((device.getDataValue("manufacturer") == "CentraLite") &&
|
else if (device.getDataValue("manufacturer") == "CentraLite") {
|
||||||
((device.getDataValue("model") == "3455-L") || (device.getDataValue("model") == "3460-L"))) {
|
if (device.getDataValue("model") == "3130") {
|
||||||
sendEvent(name: "numberOfButtons", value: 1)
|
sendEvent(name: "numberOfButtons", value: 2)
|
||||||
}
|
}
|
||||||
else if ((device.getDataValue("manufacturer") == "CentraLite") && (device.getDataValue("model") == "3450-L")) {
|
else if ((device.getDataValue("model") == "3455-L") || (device.getDataValue("model") == "3460-L")) {
|
||||||
sendEvent(name: "numberOfButtons", value: 4)
|
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 {
|
else {
|
||||||
//default. can be changed
|
//default. can be changed
|
||||||
|
|||||||
@@ -0,0 +1,51 @@
|
|||||||
|
import grails.converters.JSON
|
||||||
|
|
||||||
|
/**
|
||||||
|
* JSON API Access App
|
||||||
|
*/
|
||||||
|
|
||||||
|
definition(
|
||||||
|
name: "Bling_SmartApps",
|
||||||
|
namespace: "BlingSwitch",
|
||||||
|
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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
mappings {
|
||||||
|
path("/things") {
|
||||||
|
action: [
|
||||||
|
GET: "listThings"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
def listThings() {
|
||||||
|
[
|
||||||
|
switches: switches.collect{device(it, "switch")}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
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