Skip to content

Instantly share code, notes, and snippets.

View mager's full-sized avatar
🏠
Working from home

Mager mager

🏠
Working from home
View GitHub Profile
/**
* Silent Safety
*
* Copyright 2015 Diana Laboy-Rush
*
* 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
*
@mager
mager / httpGet.groovy
Created April 19, 2015 22:54
Example: How to make API calls from a SmartApp
/**
* Example: How to make API calls from a SmartApp
*
* Copyright 2015 SmartThings Hack
*
* 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
*
@mager
mager / keybase.md
Created April 7, 2015 16:19
keybase.md

Keybase proof

I hereby claim:

  • I am mager on github.
  • I am mager (https://keybase.io/mager) on keybase.
  • I have a public key whose fingerprint is 9D0C D280 C989 C4D0 CF63 4432 9704 0AAE 8D68 330A

To claim this, I am signing this object:

@mager
mager / smartapp-template.groovy
Created February 9, 2015 21:07
SmartThings: A new SmartApp template
/**
* My First SmartApp
*
* Copyright 2015 Andrew Mager
*
* 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
*
@mager
mager / smartthings-smartapp-control-switch-lock-with-contact-sensor.groovy
Last active August 29, 2015 14:08
SmartThings SmartApp: Control a switch with a contact sensor
/**
* Example: Control a switch with a contact sensor
*
* Copyright 2014 Andrew Mager
*
* 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
*
@mager
mager / on-off-shield.groovy
Last active August 29, 2015 14:07
On/Off Shield Device Type code
metadata {
definition (name: "On/Off Shield", namespace: "smartthings", author: "SmartThings") {
capability "Actuator"
capability "Switch"
capability "Sensor"
}
// Simulator metadata
simulator {
status "on": "catchall: 0104 0000 01 01 0040 00 0A21 00 00 0000 0A 00 0A6F6E"
@mager
mager / clapper.ino
Last active November 5, 2022 08:26
Smart Clapper Arduino sketch
/*
* SmartThings Clapper
* Author: Gilbert Chan
* Update: 10/18/14
* Contributors: Manoj Kunthu, Andrew Mager
*/
#include <SoftwareSerial.h>
#include <SmartThings.h>
@mager
mager / Gemfile
Created October 7, 2014 16:40
Example SmartApp Server using OAuth 2
source "https://rubygems.org"
gem 'sinatra'
gem 'oauth2'
gem 'json'
@mager
mager / example-restful-switch.groovy
Last active August 29, 2015 14:07
SmartThings Code Example: RESTful Switch SmartApp
/**
* Control a Switch with an API call
*
* Copyright 2014 Andrew Mager
*
* 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
*
@mager
mager / scheduler-demo.groovy
Last active August 29, 2015 14:06
Scheduler Demo SmartApp
/**
* Scheduler Demo
*
* Copyright 2014 Andrew Mager
*
* 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
*