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
|
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
|
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
|
# Python LimitlessLED via RF
Control LimitlessLED bulbs through a directly attached radio. The radio object must have an interface with a "`transmit`" method that formats messages as an LT8900 would over the air.
## API
### Synopsis
limitlessled_rf.remote(radio, remote_type, remote_id, message_id = None, config = None) -> instance
limitlessled_rf.remote.raw_send_button(button_info) -> value
limitlessled_rf.remote.raw_read_button() -> dictionary
limitlessled_rf.remote.set_brightness(brightness, zone = None) -> boolean
limitlessled_rf.remote.set_color(rgb, zone = None) -> boolean
limitlessled_rf.remote.set_temperature(kelvins, zone = None) -> boolean
limitlessled_rf.remote.on(zone = None) -> boolean
limitlessled_rf.remote.off(zone = None, dim = True) -> boolean
limitlessled_rf.remote.max_brightness(zone = None) -> boolean
limitlessled_rf.remote.white(zone = None) -> boolean
limitlessled_rf.remote.pair(zone) -> boolean
limitlessled_rf.remote.unpair(zone) -> boolean
limitlessled_rf.Remote(radio, remote_type, remote_id, message_id = None, config = None) -> instance
limitlessled_rf.Remote.raw_send_button(button_info) -> value
limitlessled_rf.Remote.raw_read_button() -> dictionary
limitlessled_rf.Remote.set_brightness(brightness, zone = None) -> boolean
limitlessled_rf.Remote.set_color(rgb, zone = None) -> boolean
limitlessled_rf.Remote.set_temperature(kelvins, zone = None) -> boolean
limitlessled_rf.Remote.on(zone = None) -> boolean
limitlessled_rf.Remote.off(zone = None, dim = True) -> boolean
limitlessled_rf.Remote.max_brightness(zone = None) -> boolean
limitlessled_rf.Remote.white(zone = None) -> boolean
limitlessled_rf.Remote.pair(zone) -> boolean
limitlessled_rf.Remote.unpair(zone) -> boolean
### Constructor
Construct a LimitlessLED object that uses the specified radio to act as a specific numeric remote for a specific type of LimitlessLED bulb system.
The "`radio`" object is an LT8900 compatible radio interface -- for example the "`lt8900_spi`" package.
|
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
|
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
|
-
+
-
+
|
def reset_module_via_gpio():
reset_gpio.off()
time.sleep(0.1)
reset_gpio.on()
time.sleep(0.1)
# LT8900 compatible radio
radio = lt8900_spi.radio(0, 0, {
radio = lt8900_spi.Radio(0, 0, {
'reset_command': reset_module_via_gpio,
'reset_command_gpio': reset_gpio
})
if not radio.initialize():
return None
return radio
radio = init_radio()
remote = limitlessled_rf.remote(radio, 'rgbw', 0x51F0)
remote = limitlessled_rf.Remote(radio, 'rgbw', 0x51F0)
while True:
remote.set_color(random.randint(0, 0xffffff))
|