mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-03-24 05:04:10 +00:00
Initial commit
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
/**
|
||||
* Copyright 2015 SmartThings
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
|
||||
* in compliance with the License. You may obtain a copy of the License at:
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
|
||||
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
|
||||
* for the specific language governing permissions and limitations under the License.
|
||||
*
|
||||
*/
|
||||
metadata {
|
||||
definition (name: "Arduino ThingShield", namespace: "smartthings", author: "SmartThings") {
|
||||
|
||||
fingerprint profileId: "0104", deviceId: "0138", inClusters: "0000"
|
||||
}
|
||||
|
||||
// Simulator metadata
|
||||
simulator {
|
||||
// status messages
|
||||
status "ping": "catchall: 0104 0000 01 01 0040 00 6A67 00 00 0000 0A 00 0A70696E67"
|
||||
status "hello": "catchall: 0104 0000 01 01 0040 00 0A21 00 00 0000 0A 00 0A48656c6c6f20576f726c6421"
|
||||
}
|
||||
|
||||
// UI tile definitions
|
||||
tiles {
|
||||
standardTile("shield", "device.shield", width: 2, height: 2) {
|
||||
state "default", icon:"st.shields.shields.arduino", backgroundColor:"#ffffff"
|
||||
}
|
||||
|
||||
main "shield"
|
||||
details "shield"
|
||||
}
|
||||
}
|
||||
|
||||
// Parse incoming device messages to generate events
|
||||
def parse(String description) {
|
||||
def value = zigbee.parse(description)?.text
|
||||
def name = value && value != "ping" ? "response" : null
|
||||
def result = createEvent(name: name, value: value)
|
||||
log.debug "Parse returned ${result?.descriptionText}"
|
||||
return result
|
||||
}
|
||||
|
||||
// Commands to device
|
||||
// TBD
|
||||
Reference in New Issue
Block a user