This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from pygments import highlight | |
from pygments.lexers import PythonLexer | |
from pygments.formatters import Terminal256Formatter | |
from pprint import pformat | |
def pprint_color(obj): | |
print highlight(pformat(obj), PythonLexer(), Terminal256Formatter()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def print_table(items, header=None, wrap=True, max_col_width=20, wrap_style="wrap", row_line=False, fix_col_width=False): | |
''' Prints a matrix of data as a human readable table. Matrix | |
should be a list of lists containing any type of values that can | |
be converted into text strings. | |
Two different column adjustment methods are supported through | |
the *wrap_style* argument: | |
wrap: it will wrap values to fit max_col_width (by extending cell height) | |
cut: it will strip values to max_col_width |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Nest Direct | |
* | |
* Author: dianoga7@3dgo.net | |
* Date: 2013-07-18 | |
* Code: https://gist.github.com/Dianoga/6055918 | |
* | |
* INSTALLATION | |
* ========================================= | |
* 1) Create a new device type (https://graph.api.smartthings.com/ide/devices) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* HVAC Auto Off | |
* | |
* Author: dianoga7@3dgo.net | |
* Date: 2013-07-21 | |
*/ | |
preferences { | |
section("Control") { | |
input("thermostat", "capability.thermostat", title: "Thermostat") | |
} |