-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdevice.go
56 lines (40 loc) · 813 Bytes
/
device.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
package govee
import (
"net"
"time"
)
type State int
const (
Off State = iota
On
)
// Device stores info about detected devices.
type Device struct {
IPAddr net.IP
MAC net.HardwareAddr
LastSeen time.Time
Spec *Spec
}
// Status is the current status of the device.
type Status struct {
State State // current state of the device either On or Off
Brightness int // brightness range from 1 to 100
Color Color // color of the device
Kelvin int // color temperature range from 2000 to 9000
}
// Color of the device
type Color struct {
R int // range 0 to 255
G int // range 0 to 255
B int // range 0 to 255
}
func (d Device) TurnOn() {
}
func (d Device) TurnOff() {
}
func (d Device) Brightness() {
}
func (d Device) Color() {
}
func (d Device) Kelvin() {
}