|
42 | 42 | from .messaging import client, protocol |
43 | 43 | from .version import __version__ |
44 | 44 |
|
45 | | -CLIENT_VERSION = 1 |
| 45 | +CLIENT_VERSION = 2 |
46 | 46 | MIN_HOST_VERSION = 0 |
47 | 47 |
|
48 | 48 |
|
@@ -339,7 +339,7 @@ def control_granted_event(self) -> asyncio.Event: |
339 | 339 |
|
340 | 340 | async def wait_for_control(conn: anki_vector.connection.Connection): |
341 | 341 | await conn.control_granted_event.wait() |
342 | | - // Run commands that require behavior control |
| 342 | + # Run commands that require behavior control |
343 | 343 | """ |
344 | 344 | return self._control_events.granted_event |
345 | 345 |
|
@@ -389,7 +389,7 @@ def release_control(self, timeout: float = 10.0): |
389 | 389 |
|
390 | 390 | async def wait_for_control(conn: anki_vector.connection.Connection): |
391 | 391 | await conn.control_granted_event.wait() |
392 | | - // Run commands that require behavior control |
| 392 | + # Run commands that require behavior control |
393 | 393 | conn.release_control() |
394 | 394 |
|
395 | 395 | :param timeout: The time allotted to attempt to release control, in seconds. |
@@ -536,11 +536,11 @@ async def _open_connections(self): |
536 | 536 | async for response in self._interface.BehaviorControl(self._request_handler()): |
537 | 537 | response_type = response.WhichOneof("response_type") |
538 | 538 | if response_type == 'control_granted_response': |
539 | | - self._logger.debug(response) |
| 539 | + self._logger.info(response) |
540 | 540 | self._control_events.update(True) |
541 | 541 | elif response_type == 'control_lost_event': |
542 | 542 | self._cancel_active() |
543 | | - self._logger.debug(response) |
| 543 | + self._logger.info(response) |
544 | 544 | self._control_events.update(False) |
545 | 545 | except futures.CancelledError: |
546 | 546 | self._logger.debug('Behavior handler task was cancelled. This is expected during disconnection.') |
@@ -591,6 +591,7 @@ def run_soon(self, coro: Awaitable) -> None: |
591 | 591 | .. testcode:: |
592 | 592 |
|
593 | 593 | import anki_vector |
| 594 | + import time |
594 | 595 |
|
595 | 596 | async def my_coroutine(): |
596 | 597 | print("Running on the connection thread") |
@@ -628,7 +629,6 @@ async def my_coroutine(): |
628 | 629 |
|
629 | 630 | with anki_vector.Robot() as robot: |
630 | 631 | result = robot.conn.run_coroutine(my_coroutine()) |
631 | | - print(result) |
632 | 632 |
|
633 | 633 | :param coro: The coroutine, task or any other awaitable which should be executed. |
634 | 634 | :returns: The result of the awaitable's execution. |
@@ -665,7 +665,7 @@ def on_connection_thread(log_messaging: bool = True, requires_control: bool = Tr |
665 | 665 | class MyComponent(anki_vector.util.Component): |
666 | 666 | @connection._on_connection_thread() |
667 | 667 | async def on_connection_thread(self): |
668 | | - // Do work on the connection thread |
| 668 | + # Do work on the connection thread |
669 | 669 |
|
670 | 670 | :param log_messaging: True if the log output should include the entire message or just the size. Recommended for |
671 | 671 | large binary return values. |
@@ -703,7 +703,7 @@ async def log_handler(conn: Connection, func: Coroutine, logger: logging.Logger, |
703 | 703 | if requires_control and not control.is_set(): |
704 | 704 | if not conn.requires_behavior_control: |
705 | 705 | raise VectorControlException(func.__name__) |
706 | | - logger.debug(f"Delaying {func.__name__} until behavior control is granted") |
| 706 | + logger.info(f"Delaying {func.__name__} until behavior control is granted") |
707 | 707 | await conn.control_granted_event.wait() |
708 | 708 | logger.debug(f'Outgoing {func.__name__}: {args[1:] if log_messaging else "size = {} bytes".format(sys.getsizeof(args[1:]))}') |
709 | 709 | try: |
|
0 commit comments