The LampStealer app for Hue does not work with newer versions of the bridge, as the API has changed. This shell script works with fewer dependencies and achieves the same. Install jq and run the shell script after pushing the big button on the bridge.
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
| #!/usr/bin/python | |
| import sys #for cmd line argv | |
| #take command line args as the input string | |
| input_string = sys.argv | |
| #remove the program name from the argv list | |
| input_string.pop(0) | |
| #convert to google friendly url (with + replacing spaces) |
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
| Rem DWD-Warnmodul (win10 1803), parameter addresse | |
| @echo off | |
| set lat=48.37& set lon=10.90 | |
| set /p lat="Enter lat(%lat%) " & set /p lon="Enter lon(%lon%) " | |
| set bridge=http://localhost:8000/api/newdeveloper | |
| if "%1"=="" (set /p bridge="change bridge adress(%bridge%) ") else (set bridge=%1) | |
| set light=1 | |
| set /p light="select light(%light%) " |
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
| // convert 0..255 R,G,B values to binary string | |
| RGBToBin = function(r,g,b){ | |
| var bin = r << 16 | g << 8 | b; | |
| return (function(h){ | |
| return new Array(25-h.length).join("0")+h | |
| })(bin.toString(2)) | |
| } | |
| // convert 0..255 R,G,B values to a hexidecimal color string | |
| RGBToHex = function(r,g,b){ |
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
| package main | |
| import ( | |
| "encoding/json" | |
| "fmt" | |
| ) | |
| func dumpMap(space string, m map[string]interface{}) { | |
| for k, v := range m { | |
| if mv, ok := v.(map[string]interface{}); ok { |
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
| # useful for running ssl server on localhost | |
| # which in turn is useful for working with WebSocket Secure (wss) | |
| # copied from http://www.piware.de/2011/01/creating-an-https-server-in-python/ |
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
| /* | |
| * base58.js | |
| * - encodes integers to and decodes from a base58 (or your own) base58 alphabet | |
| * - based on Flickr's url shortening | |
| * | |
| * usage: | |
| * base58.encode(integer); | |
| * base58.decode(string); | |
| * | |
| * (c) 2012 inflammable/raromachine |
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
| import warnings | |
| from skimage.measure import compare_ssim | |
| from skimage.transform import resize | |
| from scipy.stats import wasserstein_distance | |
| from scipy.misc import imsave | |
| from scipy.ndimage import imread | |
| import numpy as np | |
| import cv2 | |
| ## |
TSV means "tab-separated values". I prefer this format over CSV ("comma-separated values") because it doesn't require as much quoting. Many programs that can use CSV formatted data can also use TSV, although they may need to be explicitly told of the different format if it's not detected automatically.
However, in any of the jq scripts below, "@tsv" can usually be replaced with "@csv" to get CSV output instead.
OlderNewer