Python LimitlessLED via RF

Check-in [d467fada9d]
Login

Check-in [d467fada9d]

Overview
Comment:Rename to upper-case class name
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: d467fada9d1271e7c9907b51a78e26c3a71e11b2cdc791eaab20d6c58e5e6a34
User & Date: rkeene on 2020-04-29 00:40:23
Other Links: manifest | tags
Context
2020-04-29
00:40
lmitlessled_rf v0.2 check-in: be353338e5 user: rkeene tags: 0.2, trunk
00:40
Rename to upper-case class name check-in: d467fada9d user: rkeene tags: trunk
00:34
limitlessled_rf v0.1 check-in: 1e49925e09 user: rkeene tags: 0.1, trunk
Changes

Modified README.md from [c4976858c8] to [779c0688d1].

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

### 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.









|
|
|
|
|
|
|
|
|
|
|
|







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

### 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
    	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, {
    		'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)
    
    while True:
    	remote.set_color(random.randint(0, 0xffffff))







|










|



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, {
    		'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)
    
    while True:
    	remote.set_color(random.randint(0, 0xffffff))

Modified limitlessled_rf/__init__.py from [796fb9f34b] to [e5093660f8].

1
2
3
4
5
6
7
8
9
10
11
12
13
#! /usr/bin/env python3

import random
import time

class remote:
	_remote_type_alias_map = {
		'fut089': 'rgb+cct'
	}
	_remote_type_parameters_map = {
		'rgbw': {
			'retries':  3,
			'delay':    0.005,





|







1
2
3
4
5
6
7
8
9
10
11
12
13
#! /usr/bin/env python3

import random
import time

class Remote:
	_remote_type_alias_map = {
		'fut089': 'rgb+cct'
	}
	_remote_type_parameters_map = {
		'rgbw': {
			'retries':  3,
			'delay':    0.005,