Overview
Comment: | Allow multiple queues to be used |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
4685a421d167c6efdda38f8956901cb3 |
User & Date: | rkeene on 2020-05-01 01:35:49 |
Other Links: | manifest | tags |
Context
2020-05-02
| ||
15:11 | Fix bug where stepping up/down was not effective check-in: 05b79c5264 user: rkeene tags: trunk | |
2020-05-01
| ||
01:35 | Allow multiple queues to be used check-in: 4685a421d1 user: rkeene tags: trunk | |
2020-04-30
| ||
03:31 | limitlessled_rf v0.9 check-in: 56c42e61c4 user: rkeene tags: 0.9, trunk | |
Changes
Modified limitlessled_rf/__init__.py from [f0d3890212] to [5f657e4ec6].
1 2 3 4 5 6 7 8 9 10 11 12 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | - + | #! /usr/bin/env python3 import random import time class Remote: _remote_type_alias_map = { 'fut089': 'rgb+cct' } _remote_type_parameters_map = { 'rgbw': { 'retries': 10, |
︙ | |||
105 106 107 108 109 110 111 112 113 114 115 116 117 118 | 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | + | 'syncword': [0xAA55, 0x50A0] } } def __init__(self, radio, remote_type, remote_id, message_id = None, config = None): # Pull in the config for this remote type self._config = self._get_type_parameters(remote_type) self._config['radio_queue'] = '__DEFAULT__' # Allow the user to specify some more parameters if config is not None: self._config.update(config) # Store parameters self._radio = radio |
︙ | |||
142 143 144 145 146 147 148 | 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | + - + | def _debug(self, message): if 'debug_log_command' in self._config: self._config['debug_log_command'](message) return None def _get_type_parameters(self, remote_type): config = {} |
︙ | |||
193 194 195 196 197 198 199 200 201 202 | 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 | + + + - + - + | button_name = button_name + ':' + str(zone) # Look up the button button_id = self._config['button_map'][button_name] # Compute message body body = [zone, button_id, message_id] # Compute the whole message so far message = header + body # Compute message trailer ## Include a CRC, for good measure ? |
︙ | |||
367 368 369 370 371 372 373 | 372 373 374 375 376 377 378 379 380 381 382 383 384 385 | - - - | def _get_next_message_id(self): # Determine next message ID self._message_id = (self._message_id + 1) & 0xff return self._message_id def _send_button(self, button_info): |
︙ | |||
394 395 396 397 398 399 400 | 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 | - - + + | else: delay = self._config['delay'] if 'retries' in button_info: retries = button_info['retries'] else: retries = self._config['retries'] |
︙ | |||
441 442 443 444 445 446 447 448 449 | 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 | + + + - + + + + - + - - - + - - - + | use_max_button = True if use_max_button: self._debug("[INITIAL] Going to max {}".format(button_prefix)) getattr(self, "_max_{}".format(button_prefix))(zone) else: # Otherwise, step it step_command = {'button': "{}_{}".format(button_prefix, initial_direction)} if zone is not None: step_command['zone'] = zone for step in range(initial_steps): self._debug("[INITIAL] Stepping {} {}".format(button_prefix, initial_direction)) |
︙ | |||
705 706 707 708 709 710 711 | 709 710 711 712 713 714 715 716 717 718 | + + + | # If the remote has no control over the temperature this # query gets a null response if 'temperature_input_range' not in self._config: return None # Otherwise return with what we accept as temperature ranges return self._config['temperature_input_range'] def get_radio(self): return self._radio |