* for the specific language governing permissions and limitations under the License.
*
*/
+
definition(
name: "Example: Control a switch and lock with a contact sensor",
namespace: "com.smarthings.developers",
// This function is where you initialize callbacks for event listeners
def initialize() {
- // The subscribe function takes a input, a state, and a callback method
subscribe(contact, "contact.open", openHandler)
subscribe(contact, "contact.closed", closedHandler)
}