-
Notifications
You must be signed in to change notification settings - Fork 0
/
flags.go
87 lines (73 loc) · 1.56 KB
/
flags.go
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
package main
import (
"flag"
"time"
"go.yhsif.com/flagutils"
"go.yhsif.com/lifxlan"
)
var (
noack = flag.Bool(
"noack",
false,
"Do not require ack for drawing API calls.",
)
discoverTimeout = flag.Duration(
"discoverTimeout",
time.Second*2,
"Timeout for discover API calls.",
)
drawTimeout = flag.Duration(
"drawTimeout",
time.Millisecond*200,
"Timeout for drawing API calls.",
)
interval = flag.Duration(
"interval",
time.Millisecond*1500,
"Interval between 2 frames.",
)
broadcastHost = flag.String(
"broadcastHost",
"",
`Broadcast IP (e.g. "192.168.1.255"). Empty value means "255.255.255.255", which should work in most networks.`,
)
generations = flag.Int(
"generations",
20,
"Number of generations before stop. 0 means never stop (but still stops when the board is empty).",
)
loop = flag.Bool(
"loop",
false,
"After reached the number of generations, reset the board and loop over instead of reverting to the original colors.",
)
kelvin = flag.Int(
"kelvin",
4000,
"The Kelvin value of the color, in range of [2500, 9000].",
)
turnon = flag.Bool(
"turnon",
false,
"Turn on the device if it's not already on, and turn it off afterwards when -loop was not set.",
)
origColor = &flagutils.RGB{
R: 0xff,
G: 0xff,
B: 0xff,
}
target lifxlan.Target
)
func init() {
flag.Var(
&target,
"target",
"The MAC address of the target tile device. Empty value means any (first) tile device.",
)
flag.Var(
origColor,
"color",
"The hex color to use, in format of `rrggbb`.",
)
flag.Parse()
}