-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathenums.go
More file actions
71 lines (60 loc) · 1.43 KB
/
enums.go
File metadata and controls
71 lines (60 loc) · 1.43 KB
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
//go:generate enumer -type=gatewayDeviceModel -transform=snake -trimprefix=dev
//go:generate enumer -type=fldName -transform=snake -trimprefix=field
//go:generate enumer -type=internalClick -transform=snake -trimprefix=cl
package miio
const (
cmdGetDevices = "get_id_list"
cmdGetDeviceState = "read"
cmdDeviceReport = "report"
cmdSetDeviceState = "write"
cmdHandShake = "handshake"
cmdHeartBeat = "heartbeat"
cmdGetStatus = "get_status"
cmdStart = "app_start"
cmdStop = "app_stop"
cmdPause = "app_pause"
cmdDock = "app_charge"
cmdFindMe = "find_me"
cmdFanPower = "set_custom_mode"
)
// Gateway device model.
type gatewayDeviceModel int
const (
devGateway gatewayDeviceModel = iota
devSwitch
devSensorHT
devMagnet
devMotion
)
// Field names.
type fldName int
const (
fieldRGB fldName = iota
fieldTemperature
fieldHumidity
fieldVoltage
fieldStatus
fieldNoMotion
)
// ClickType represents Xiaomi switch state.
type ClickType int
const (
// ClickNo describes no click.
ClickNo ClickType = iota
// ClickSingle describes single click.
ClickSingle
// ClickDouble describes double click.
ClickDouble
// ClickLongPress describes the beginning of a long click.
ClickLongPress
// ClickLongRelease describes the end of a long click.
ClickLongRelease
)
// Internal click type.
type internalClick int
const (
clClick internalClick = iota
clDoubleClick
clLongClickPress
clLongClickRelease
)