util  Check-in [967c6eaf26]

Overview
Comment:add hue api
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 967c6eaf26a2e20eecf0fe36774a4e075dbd73a4bc83c1bd0a93b325b95709db
User & Date: lexi on 2019-05-06 23:35:45
Other Links: manifest | tags
Context
2019-07-13
07:07
add rosshil, misc updates check-in: ff13f110ee user: lexi tags: trunk
2019-05-06
23:35
add hue api check-in: 967c6eaf26 user: lexi tags: trunk
2019-05-04
03:20
more updats check-in: 514964602b user: lexi tags: trunk
Changes

Added light/candle.fish version [2100b7d3df].

            1  +#!/usr/bin/fish
            2  +# vi:syntax=zsh
            3  +source inc.fish
            4  +
            5  +put state (json on:true)
            6  +
            7  +while true
            8  +	put state (json bri:(random 20 100))
            9  +	sleep 0.(random 0 2)
           10  +end
           11  +
           12  +

Added light/inc.fish version [2bb384df8e].

            1  +#!/usr/bin/fish
            2  +# vi:syntax=zsh
            3  +set apikey eoBeM0xXhuJ8oRjIqTmrx9fuuUVPH0uyKseiYHNf
            4  +set bridge 192.168.43.254
            5  +set api http://$bridge/api/$apikey
            6  +set lights 1 2
            7  +
            8  +function put
            9  +	for light in $lights
           10  +		echo "$argv[2..-1]" | curl -sS -T - $api/lights/$light/$argv[1] >/dev/null
           11  +	end
           12  +end
           13  +function json
           14  +	echo -n "{"
           15  +	set start 1
           16  +	for i in $argv
           17  +		test $start -eq 0; and echo -n ,
           18  +		echo -n $i | sed 's;^\(.*\):\(.*\)$;"\1":\2;g'
           19  +		set start 0
           20  +	end
           21  +	echo -n "}"
           22  +end
           23  +
           24  +function die
           25  +	put state (json bri:112 hue:60954 sat:254)
           26  +	exit 0
           27  +end
           28  +
           29  +trap 'die' USR1
           30  +

Added light/pulse.fish version [2c432d2aa9].

            1  +#!/usr/bin/fish
            2  +# vi:syntax=zsh
            3  +source inc.fish
            4  +
            5  +put state (json on:true)
            6  +
            7  +while true
            8  +	put state (json bri:(random 200 254) hue:(random 35000 65000))
            9  +	sleep 0.3
           10  +	put state (json bri:0)
           11  +	sleep 0.3
           12  +end
           13  +
           14  +