-
Notifications
You must be signed in to change notification settings - Fork 190
/
Copy pathconstants.go
53 lines (46 loc) · 1.15 KB
/
constants.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
package characteristic
const (
PermRead = "pr" // can be read
PermWrite = "pw" // can be written
PermEvents = "ev" // sends events
PermHidden = "hd" // is hidden
PermWriteResponse = "wr"
)
// PermsAll returns read, write and event permissions
func PermsAll() []string {
return []string{PermRead, PermWrite, PermEvents}
}
// PermsRead returns read and event permissions
func PermsRead() []string {
return []string{PermRead, PermEvents}
}
// PermsReadOnly returns read permission
func PermsReadOnly() []string {
return []string{PermRead}
}
// PermsWriteOnly returns write permission
func PermsWriteOnly() []string {
return []string{PermWrite}
}
// HAP characteristic units
const (
UnitPercentage = "percentage"
UnitArcDegrees = "arcdegrees"
UnitCelsius = "celsius"
UnitLux = "lux"
UnitSeconds = "seconds"
UnitPPM = "ppm"
)
// HAP characteristic formats
const (
FormatString = "string"
FormatBool = "bool"
FormatFloat = "float"
FormatUInt8 = "uint8"
FormatUInt16 = "uint16"
FormatUInt32 = "uint32"
FormatInt32 = "int32"
FormatUInt64 = "uint64"
FormatData = "data"
FormatTLV8 = "tlv8"
)