Skip to content

Instantly share code, notes, and snippets.

/**
* Copyright 2014 SmartThings
*
* 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
/**
* Copyright 2014 SmartThings
*
* 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
@joshualyon
joshualyon / SmartWeatherStationTile.groovy
Last active August 29, 2015 14:17
SmartWeather Station Tile
/**
* SmartWeather Station
*
* Author: SmartThings
*
* Date: 2013-04-30
*/
// for the UI
metadata {
// Automatically generated. Make future change here.
metadata {
// Automatically generated. Make future change here.
// Mostly core Z-Wave Thermostat Code from SmartThings
// Just a few modifications made by Josh to add the current operating state tiles
definition (name: "TStat with State", namespace: "boshdirect", author: "SmartThings + Josh Lyon") {
capability "Actuator"
capability "Temperature Measurement"
capability "Relative Humidity Measurement"
capability "Thermostat"
capability "Configuration"

Keybase proof

I hereby claim:

  • I am iamcanadian2222 on github.
  • I am joshua_lyon (https://keybase.io/joshua_lyon) on keybase.
  • I have a public key whose fingerprint is ADB8 E8E4 2072 3BB4 8A62 4DD4 4028 2F7D E6C6 E59C

To claim this, I am signing this object:

@joshualyon
joshualyon / SHM Mapper Device.groovy
Last active June 18, 2018 07:10
Device type to accept mapped Smart Home Monitor states for SmartThings
/**
* SHM Mapper
*
* Copyright 2017 Josh Lyon
*
* This Device Type Handler works in unison with the custom SHM Mapper SmartApp to copy Smart Home Monitor statuses to an
* attribute of this Thing. Even though SHM code is available on the SmartThings community, it was never officially approved
* for use in officially published SmartApps.
*
* In order to get around this, the SHM Mapper SmartApp copies SHM status to the attribute of a Thing so that Thing can be
@joshualyon
joshualyon / SHM Mapper SmartApp.groovy
Last active October 13, 2018 09:57
SmartApp which subscribes to Smart Home Monitor status and maps the state to an attribute of a custom Device Handler so other apps can access the attribute
/**
* SHM Mapper
*
* Copyright 2017 Josh Lyon
*
* This SmartApp works in unison with the custom SHM Mapper device type handler to copy Smart Home Monitor statuses to an
* attribute of a Thing. Even though SHM code is available on the SmartThings community, it was never officially approved
* for use in officially published SmartApps.
*
* In order to get around this, the SHM Mapper SmartApp copies SHM status to the attribute of a Thing so that Thing can be
@joshualyon
joshualyon / simulatedBattery.groovy
Created August 15, 2017 14:42
Simulated Battery Device Type
/**
* Battery
*
* Copyright 2017 Joshua Lyon
*
* 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
*
@joshualyon
joshualyon / Output Android Icons.jsx
Last active May 30, 2019 15:47 — forked from tlinkner/Output Android Icons.jsx
Photoshop script to output Android icons (with XXXHDPI, XXHDPI, XHDPI, HDPI, MDPI support)
// Output Android Icons.jsx
// 2012 Todd Linkner
// License: none (public domain)
// v1.0 - base file by Todd Linkner
// v1.1 - added support for XXHDPI, XXXHDPI and added PNG to the file selector
//
// This script is for Photoshop CS6. It outputs Android icons of the
// following sizes from a source PSD at least 512px x 512px
//
// store:
@joshualyon
joshualyon / import_backup.py
Created May 15, 2018 22:25
App Engine Import Datastore Export (NDB/Backup)
"""
# App Engine import data from Datastore Backup to localhost
You can use this script to import large(ish) App Engine Datastore backups to your localohst dev server.
## Getting backup files
Follow instructions from Google to use `gcloud` to export datastore to a google storage bucket
Then download the export to your local machine:
```
gsutil -m cp -R gs://your_bucket_name/your_path /local_target
```