Compare commits

..

9 Commits

Author SHA1 Message Date
Vinay Rao
20239ca982 Merge pull request #1488 from SmartThingsCommunity/staging
Rolling up to production for deploy
2016-11-22 12:43:20 -08:00
Vinay Rao
b20c0e371f Merge pull request #1487 from SmartThingsCommunity/production
Rolling down production hotfix to staging
2016-11-22 12:42:25 -08:00
bflorian
ee2e1ee04f Merge pull request #1483 from juano2310/staging
DVCSMP-2211 - Update Button Number
2016-11-18 14:55:18 -08:00
juano2310
e443cb641c DVCSMP-2211 - Update Button Number 2016-11-18 11:28:30 -05:00
Vinay Rao
b9993a9bf2 Merge pull request #1480 from SmartThingsCommunity/master
Rolling up master to staging
2016-11-16 13:38:01 -08:00
Vinay Rao
a8ee927893 Merge pull request #1479 from varzac/fix-motion-sensor
[DPROT-200] Fix broken generation of smartsense-motion events
2016-11-16 08:55:13 -08:00
Zach Varberg
51979f0030 Fix broken generation of smartsense-motion events
When the change went out to allow messages to be passed up to the cloud
the smartsense-motion DTH was broken with the changes for
https://smartthings.atlassian.net/browse/DPROT-200
2016-11-16 10:44:48 -06:00
Vinay Rao
1dfd1818b4 Merge pull request #1471 from SmartThingsCommunity/master
Rolling up master to staging
2016-11-15 14:05:57 -08:00
Vinay Rao
e5c21ef720 Merge pull request #1469 from SmartThingsCommunity/staging
Rolling up staging for production deploy
2016-11-15 13:18:56 -08:00
6 changed files with 38 additions and 94 deletions

View File

@@ -120,6 +120,15 @@ def configure() {
return cmd
}
def installed() {
initialize()
}
def updated() {
initialize()
}
def initialize() {
sendEvent(name: "numberOfButtons", value: 4)
}

View File

@@ -109,6 +109,15 @@ def configure() {
return cmds
}
def installed() {
initialize()
}
def updated() {
initialize()
}
def initialize() {
sendEvent(name: "numberOfButtons", value: 4)
}

View File

@@ -183,6 +183,15 @@ def updateState(String name, String value) {
device.updateDataValue(name, value)
}
def installed() {
initialize()
}
def updated() {
initialize()
}
def initialize() {
sendEvent(name: "numberOfButtons", value: 3)
}

View File

@@ -57,6 +57,7 @@ def parse(String description) {
private Map parseBasicMessage(description) {
def name = parseName(description)
def results = [:]
if (name != null) {
def value = parseValue(description)
def linkText = getLinkText(device)
@@ -64,7 +65,7 @@ private Map parseBasicMessage(description) {
def handlerName = value
def isStateChange = isStateChange(device, name, value)
def results = [
results = [
name : name,
value : value,
linkText : linkText,
@@ -73,8 +74,6 @@ private Map parseBasicMessage(description) {
isStateChange : isStateChange,
displayed : displayed(description, isStateChange)
]
} else {
results = [:]
}
log.debug "Parse returned $results.descriptionText"
return results

View File

@@ -126,6 +126,15 @@ private hold(button) {
sendEvent(name: "button", value: "held", data: [buttonNumber: button], descriptionText: "$device.displayName button $button was held", isStateChange: true)
}
def installed() {
initialize()
}
def updated() {
initialize()
}
def initialize() {
sendEvent(name: "numberOfButtons", value: 4)
}

View File

@@ -1,91 +0,0 @@
/**
* Switch Sync
*
* Copyright 2016 Kelly Kristek
*
* 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.
*
*/
definition(
name: "Switch Sync",
namespace: "Electricview",
author: "Kelly Kristek",
description: "This is an app that attempts to keep your virtual 3 way switches in sync regardless of where they are iniated from.\r\n",
category: "Convenience",
iconUrl: "http://i230.photobucket.com/albums/ee70/pickyassgamer/switchsyncsmall.png",
iconX2Url: "http://i230.photobucket.com/albums/ee70/pickyassgamer/switchsyncmedium.png",
iconX3Url: "http://i230.photobucket.com/albums/ee70/pickyassgamer/switchsync.png")
preferences {
section("Select Mains Switch") {
input "firstswitch", "capability.switch", required: true
}
section("Select AUX switch") {
input "secondswitch", "capability.switch", required: true
}
}
def installed() {
log.debug "Installed with settings: ${settings}"
initialize()
}
def updated() {
log.debug "Updated with settings: ${settings}"
unsubscribe()
initialize()
}
def initialize() {
subscribe(firstswitch, "switch.on", firstswitchon)
subscribe(firstswitch, "switch.off", firstswitchoff)
subscribe(secondswitch,"switch.on", secondswitchon)
subscribe(secondswitch,"switch.off", secondswitchoff)
}
def firstswitchon(evt){
log.debug "FirstSwitchOn called: $evt"
// Adding an if statement to verify the switch isn't already in the position we desire, to avoid endless loops
if( "off" == secondswitch.currentSwitch) {
secondswitch.on()
}
}
def firstswitchoff(evt){
log.debug "FirstSwitchOff called: $evt"
// Adding an if statement to verify the switch isn't already in the position we desire, to avoid endless loops
if ( "on" == secondswitch.currentSwitch){
secondswitch.off()
}
}
def secondswitchon(evt){
log.debug "SecondSwitchOn called: $evt"
// Adding an if statement to verify the switch isn't already in the position we desire, to avoid endless loops
if ( "off" == firstswitch.currentSwitch){
firstswitch.on()
}
}
def secondswitchoff(evt){
log.debug "SecondSwitchOff called: $evt"
// Adding an if statement to verify the switch isn't already in the position we desire, to avoid endless loops
if ( "on" == firstswitch.currentSwitch){
firstswitch.off()
}
}
// TODO: implement event handlers