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
2
3
4
5
6
7
8
9
10
11
12
#!/usr/bin/fish
# vi:syntax=zsh
source inc.fish

put state (json on:true)

while true
	put state (json bri:(random 20 100))
	sleep 0.(random 0 2)
end


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





























































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/usr/bin/fish
# vi:syntax=zsh
set apikey eoBeM0xXhuJ8oRjIqTmrx9fuuUVPH0uyKseiYHNf
set bridge 192.168.43.254
set api http://$bridge/api/$apikey
set lights 1 2

function put
	for light in $lights
		echo "$argv[2..-1]" | curl -sS -T - $api/lights/$light/$argv[1] >/dev/null
	end
end
function json
	echo -n "{"
	set start 1
	for i in $argv
		test $start -eq 0; and echo -n ,
		echo -n $i | sed 's;^\(.*\):\(.*\)$;"\1":\2;g'
		set start 0
	end
	echo -n "}"
end

function die
	put state (json bri:112 hue:60954 sat:254)
	exit 0
end

trap 'die' USR1

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





























>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/usr/bin/fish
# vi:syntax=zsh
source inc.fish

put state (json on:true)

while true
	put state (json bri:(random 200 254) hue:(random 35000 65000))
	sleep 0.3
	put state (json bri:0)
	sleep 0.3
end