mirror of
https://github.com/mtan93/SmartThingsPublic.git
synced 2026-04-12 14:23:07 +01:00
SSVD-1823 - Indicator Light Preference page (#1080)
required = false indentation Bob's update
This commit is contained in:
@@ -15,7 +15,7 @@ metadata {
|
|||||||
definition (name: "Z-Wave Switch", namespace: "smartthings", author: "SmartThings") {
|
definition (name: "Z-Wave Switch", namespace: "smartthings", author: "SmartThings") {
|
||||||
capability "Actuator"
|
capability "Actuator"
|
||||||
capability "Indicator"
|
capability "Indicator"
|
||||||
capability "Switch"
|
capability "Switch"
|
||||||
capability "Polling"
|
capability "Polling"
|
||||||
capability "Refresh"
|
capability "Refresh"
|
||||||
capability "Sensor"
|
capability "Sensor"
|
||||||
@@ -33,6 +33,10 @@ metadata {
|
|||||||
reply "200100,delay 100,2502": "command: 2503, payload: 00"
|
reply "200100,delay 100,2502": "command: 2503, payload: 00"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
preferences {
|
||||||
|
input "ledIndicator", "enum", title: "LED Indicator", description: "Turn LED indicator... ", required: false, options:["on": "When On", "off": "When Off", "never": "Never"], defaultValue: "off"
|
||||||
|
}
|
||||||
|
|
||||||
// tile definitions
|
// tile definitions
|
||||||
tiles(scale: 2) {
|
tiles(scale: 2) {
|
||||||
multiAttributeTile(name:"switch", type: "lighting", width: 6, height: 4, canChangeIcon: true){
|
multiAttributeTile(name:"switch", type: "lighting", width: 6, height: 4, canChangeIcon: true){
|
||||||
@@ -52,10 +56,35 @@ metadata {
|
|||||||
}
|
}
|
||||||
|
|
||||||
main "switch"
|
main "switch"
|
||||||
details(["switch","refresh","indicator"])
|
details(["switch","refresh"])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def installed(){
|
||||||
|
initialized()
|
||||||
|
}
|
||||||
|
|
||||||
|
def updated(){
|
||||||
|
initialized()
|
||||||
|
}
|
||||||
|
|
||||||
|
def initialized() {
|
||||||
|
switch (ledIndicator) {
|
||||||
|
case "on":
|
||||||
|
indicatorWhenOn()
|
||||||
|
break
|
||||||
|
case "off":
|
||||||
|
indicatorWhenOff()
|
||||||
|
break
|
||||||
|
case "never":
|
||||||
|
indicatorNever()
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
indicatorWhenOn()
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
def parse(String description) {
|
def parse(String description) {
|
||||||
def result = null
|
def result = null
|
||||||
def cmd = zwave.parse(description, [0x20: 1, 0x70: 1])
|
def cmd = zwave.parse(description, [0x20: 1, 0x70: 1])
|
||||||
@@ -139,19 +168,19 @@ def refresh() {
|
|||||||
])
|
])
|
||||||
}
|
}
|
||||||
|
|
||||||
def indicatorWhenOn() {
|
void indicatorWhenOn() {
|
||||||
sendEvent(name: "indicatorStatus", value: "when on", display: false)
|
sendEvent(name: "indicatorStatus", value: "when on", display: false)
|
||||||
zwave.configurationV1.configurationSet(configurationValue: [1], parameterNumber: 3, size: 1).format()
|
sendHubCommand(new physicalgraph.device.HubAction(zwave.configurationV1.configurationSet(configurationValue: [1], parameterNumber: 3, size: 1).format()))
|
||||||
}
|
}
|
||||||
|
|
||||||
def indicatorWhenOff() {
|
void indicatorWhenOff() {
|
||||||
sendEvent(name: "indicatorStatus", value: "when off", display: false)
|
sendEvent(name: "indicatorStatus", value: "when off", display: false)
|
||||||
zwave.configurationV1.configurationSet(configurationValue: [0], parameterNumber: 3, size: 1).format()
|
sendHubCommand(new physicalgraph.device.HubAction(zwave.configurationV1.configurationSet(configurationValue: [0], parameterNumber: 3, size: 1).format()))
|
||||||
}
|
}
|
||||||
|
|
||||||
def indicatorNever() {
|
void indicatorNever() {
|
||||||
sendEvent(name: "indicatorStatus", value: "never", display: false)
|
sendEvent(name: "indicatorStatus", value: "never", display: false)
|
||||||
zwave.configurationV1.configurationSet(configurationValue: [2], parameterNumber: 3, size: 1).format()
|
sendHubCommand(new physicalgraph.device.HubAction(zwave.configurationV1.configurationSet(configurationValue: [2], parameterNumber: 3, size: 1).format()))
|
||||||
}
|
}
|
||||||
|
|
||||||
def invertSwitch(invert=true) {
|
def invertSwitch(invert=true) {
|
||||||
|
|||||||
Reference in New Issue
Block a user