mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-03-19 05:10:51 +00:00
Compare commits
1 Commits
PROD_2016.
...
MSA-940-1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9712f04850 |
@@ -9,6 +9,7 @@ metadata {
|
|||||||
definition (name: "Hue Lux Bulb", namespace: "smartthings", author: "SmartThings") {
|
definition (name: "Hue Lux Bulb", namespace: "smartthings", author: "SmartThings") {
|
||||||
capability "Switch Level"
|
capability "Switch Level"
|
||||||
capability "Actuator"
|
capability "Actuator"
|
||||||
|
capability "Color Temperature"
|
||||||
capability "Switch"
|
capability "Switch"
|
||||||
capability "Refresh"
|
capability "Refresh"
|
||||||
capability "Sensor"
|
capability "Sensor"
|
||||||
@@ -47,12 +48,19 @@ metadata {
|
|||||||
state "level", action:"switch level.setLevel"
|
state "level", action:"switch level.setLevel"
|
||||||
}
|
}
|
||||||
|
|
||||||
standardTile("refresh", "device.switch", inactiveLabel: false, decoration: "flat", width: 2, height: 2) {
|
controlTile("colorTempSliderControl", "device.colorTemperature", "slider", width: 4, height: 2, inactiveLabel: false, range:"(2000..6500)") {
|
||||||
|
state "colorTemperature", action:"color temperature.setColorTemperature"
|
||||||
|
}
|
||||||
|
valueTile("colorTemp", "device.colorTemperature", inactiveLabel: false, decoration: "flat", width: 2, height: 2) {
|
||||||
|
state "colorTemperature", label: '${currentValue} K'
|
||||||
|
}
|
||||||
|
|
||||||
|
standardTile("refresh", "device.switch", inactiveLabel: false, decoration: "flat") {
|
||||||
state "default", label:"", action:"refresh.refresh", icon:"st.secondary.refresh"
|
state "default", label:"", action:"refresh.refresh", icon:"st.secondary.refresh"
|
||||||
}
|
}
|
||||||
|
|
||||||
main(["switch"])
|
main(["switch"])
|
||||||
details(["rich-control", "refresh"])
|
details(["rich-control", "colorTempSliderControl", "colorTemp", "refresh"])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,6 +98,14 @@ void setLevel(percent) {
|
|||||||
sendEvent(name: "level", value: percent)
|
sendEvent(name: "level", value: percent)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void setColorTemperature(value) {
|
||||||
|
if (value) {
|
||||||
|
log.trace "setColorTemperature: ${value}k"
|
||||||
|
parent.setColorTemperature(this, value)
|
||||||
|
sendEvent(name: "colorTemperature", value: value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void refresh() {
|
void refresh() {
|
||||||
log.debug "Executing 'refresh'"
|
log.debug "Executing 'refresh'"
|
||||||
parent.manualRefresh()
|
parent.manualRefresh()
|
||||||
|
|||||||
@@ -32,15 +32,14 @@ metadata {
|
|||||||
attributeState("default", label:'${currentValue}', unit:"dF")
|
attributeState("default", label:'${currentValue}', unit:"dF")
|
||||||
}
|
}
|
||||||
tileAttribute("device.temperature", key: "VALUE_CONTROL") {
|
tileAttribute("device.temperature", key: "VALUE_CONTROL") {
|
||||||
attributeState("VALUE_UP", action: "tempUp")
|
attributeState("default", action: "setTemperature")
|
||||||
attributeState("VALUE_DOWN", action: "tempDown")
|
|
||||||
}
|
}
|
||||||
tileAttribute("device.humidity", key: "SECONDARY_CONTROL") {
|
tileAttribute("device.humidity", key: "SECONDARY_CONTROL") {
|
||||||
attributeState("default", label:'${currentValue}%', unit:"%")
|
attributeState("default", label:'${currentValue}%', unit:"%")
|
||||||
}
|
}
|
||||||
tileAttribute("device.thermostatOperatingState", key: "OPERATING_STATE") {
|
tileAttribute("device.thermostatOperatingState", key: "OPERATING_STATE") {
|
||||||
attributeState("idle", backgroundColor:"#44b621")
|
attributeState("idle", backgroundColor:"#44b621")
|
||||||
attributeState("heating", backgroundColor:"#ea5462")
|
attributeState("heating", backgroundColor:"#ffa81e")
|
||||||
attributeState("cooling", backgroundColor:"#269bd2")
|
attributeState("cooling", backgroundColor:"#269bd2")
|
||||||
}
|
}
|
||||||
tileAttribute("device.thermostatMode", key: "THERMOSTAT_MODE") {
|
tileAttribute("device.thermostatMode", key: "THERMOSTAT_MODE") {
|
||||||
|
|||||||
46
devicetypes/test11/test1.src/test1.groovy
Normal file
46
devicetypes/test11/test1.src/test1.groovy
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
/**
|
||||||
|
* test1
|
||||||
|
*
|
||||||
|
* Copyright 2016 임희진
|
||||||
|
*
|
||||||
|
* 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: "test1", namespace: "test11", author: "임희진") {
|
||||||
|
capability "Lock"
|
||||||
|
}
|
||||||
|
|
||||||
|
simulator {
|
||||||
|
// TODO: define status and reply messages here
|
||||||
|
}
|
||||||
|
|
||||||
|
tiles {
|
||||||
|
// TODO: define your main and details tiles here
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// parse events into attributes
|
||||||
|
def parse(String description) {
|
||||||
|
log.debug "Parsing '${description}'"
|
||||||
|
// TODO: handle 'lock' attribute
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// handle commands
|
||||||
|
def lock() {
|
||||||
|
log.debug "Executing 'lock'"
|
||||||
|
// TODO: handle 'lock' command
|
||||||
|
}
|
||||||
|
|
||||||
|
def unlock() {
|
||||||
|
log.debug "Executing 'unlock'"
|
||||||
|
// TODO: handle 'unlock' command
|
||||||
|
}
|
||||||
@@ -76,7 +76,7 @@ def mainPage() {
|
|||||||
}
|
}
|
||||||
section{
|
section{
|
||||||
input "actionType", "enum", title: "Action?", required: true, defaultValue: "Bell 1", options: [
|
input "actionType", "enum", title: "Action?", required: true, defaultValue: "Bell 1", options: [
|
||||||
"Custom Message",
|
//"Custom Message",
|
||||||
"Bell 1",
|
"Bell 1",
|
||||||
"Bell 2",
|
"Bell 2",
|
||||||
"Dogs Barking",
|
"Dogs Barking",
|
||||||
@@ -89,7 +89,7 @@ def mainPage() {
|
|||||||
"Someone is arriving",
|
"Someone is arriving",
|
||||||
"Piano",
|
"Piano",
|
||||||
"Lightsaber"]
|
"Lightsaber"]
|
||||||
input "message","text",title:"Play this message", required:false, multiple: false
|
//input "message","text",title:"Play this message", required:false, multiple: false
|
||||||
}
|
}
|
||||||
section {
|
section {
|
||||||
input "sonos", "capability.musicPlayer", title: "On this Speaker player", required: true
|
input "sonos", "capability.musicPlayer", title: "On this Speaker player", required: true
|
||||||
@@ -408,15 +408,13 @@ private loadText() {
|
|||||||
case "Lightsaber":
|
case "Lightsaber":
|
||||||
state.sound = [uri: "http://s3.amazonaws.com/smartapp-media/sonos/lightsaber.mp3", duration: "10"]
|
state.sound = [uri: "http://s3.amazonaws.com/smartapp-media/sonos/lightsaber.mp3", duration: "10"]
|
||||||
break;
|
break;
|
||||||
case "Custom Message":
|
default:
|
||||||
if (message) {
|
/*if (message) {
|
||||||
state.sound = textToSpeech(message instanceof List ? message[0] : message) // not sure why this is (sometimes) needed)
|
state.sound = textToSpeech(message instanceof List ? message[0] : message) // not sure why this is (sometimes) needed)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
state.sound = textToSpeech("You selected the custom message option but did not enter a message in the $app.label Smart App")
|
state.sound = textToSpeech("You selected the custom message option but did not enter a message in the $app.label Smart App")
|
||||||
}
|
}*/
|
||||||
break;
|
|
||||||
default:
|
|
||||||
state.sound = [uri: "http://s3.amazonaws.com/smartapp-media/sonos/bell1.mp3", duration: "10"]
|
state.sound = [uri: "http://s3.amazonaws.com/smartapp-media/sonos/bell1.mp3", duration: "10"]
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user