-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathicuestructs.py
More file actions
68 lines (58 loc) · 1.6 KB
/
icuestructs.py
File metadata and controls
68 lines (58 loc) · 1.6 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
from ctypes import c_bool, c_double, c_int, c_char_p, POINTER, Structure
class CorsairProtocolDetails(Structure):
"""
Structure representing protocol details
"""
__slots__ = [
"sdkVersion",
"serverVersion",
"sdkProtocolVersion",
"serverProtocolVersion",
"breakingChanges"
]
_fields_ = [
("sdkVersion", c_char_p),
("serverVersion", c_char_p),
("sdkProtocolVersion", c_int),
("serverProtocolVersion", c_int),
("breakingChanges", c_bool)
]
class CorsairLedPosition(Structure):
"""
Structure representing a LED position
"""
_fields_ = [
("ledId", c_int),
("top", c_double),
("left", c_double),
("height", c_double),
("width", c_double)
]
class CorsairLedPositions(Structure):
"""
Structure representing LED positions
"""
_fields_ = [
("numberOfLeds", c_int),
("pLedPosition", POINTER(CorsairLedPosition))
]
class CorsairLedColor(Structure):
"""
Structure representing a LED color
"""
_fields_ = [
("ledId", c_int),
("r", c_int),
("g", c_int),
("b", c_int)
]
def __init__(self, led_id, r, g, b):
"""
Args:
led_id (CLK or int): The LED id you want to set
r (int): Red component value
g (int): Green component value
b (int): You guessed it! Blue component value
"""
# led_id = led_id.value if isinstance(led_id, CLK) else led_id
super(CorsairLedColor, self).__init__(led_id, r, g, b)