Skip to content

Instantly share code, notes, and snippets.

@Dianoga
Last active September 30, 2015 14:48
Show Gist options
  • Save Dianoga/a39f65b964ecc6a706d9 to your computer and use it in GitHub Desktop.
Save Dianoga/a39f65b964ecc6a706d9 to your computer and use it in GitHub Desktop.
/**
* Test
*
* Copyright 2015 Brian Steere
*
* 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.
* A test with quotes "thing in quotes"
*
*/
definition(
name: "Test",
namespace: "dianoga",
author: "Brian Steere",
description: "test with \"quotes\"",
category: "",
iconUrl: "https://s3.amazonaws.com/smartapp-icons/Convenience/Cat-Convenience.png",
iconX2Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/[email protected]",
iconX3Url: "https://s3.amazonaws.com/smartapp-icons/Convenience/[email protected]")
preferences {
section("Title") {
input "outlet", "capability.switch", multiple: false
input "contact", "capability.contactSensor", multiple: false
}
}
def installed() {
log.debug "Installed with settings: ${settings}"
initialize()
}
def updated() {
log.debug "Updated with settings: ${settings}"
unsubscribe()
initialize()
}
def initialize() {
subscribe(contact, "contact", myHandler)
}
def myHandler(evt) {
log.debug "$outlet.currentSwitch"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment