Skip to content

Commit

Permalink
Make API.register_callback() async again.
Browse files Browse the repository at this point in the history
Partially reverts commit 686b1fa.
  • Loading branch information
SyntaxColoring committed Aug 18, 2021
1 parent 233ef3d commit 5343b36
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion api/src/opentrons/hardware_control/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ def _calculate_valid_attitude(self) -> DeckTransformState:
return rb_cal.validate_attitude_deck_calibration(
self._robot_calibration.deck_calibration)

def register_callback(self, cb):
async def register_callback(self, cb):
""" Allows the caller to register a callback, and returns a closure
that can be used to unregister the provided callback
"""
Expand Down
2 changes: 1 addition & 1 deletion robot-server/robot_server/hardware_initialization.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ async def initialize(event_publisher: Publisher) -> ThreadManager:
# fixme(mm, 2021-08-12): This might be a typing error. forward() can only
# take a HardwareEvent, but it looks like ThreadManager can also pass
# other things as the argument to a callback?
thread_manager.register_callback(door_event_forwarder.forward)
await thread_manager.register_callback(door_event_forwarder.forward)

log.info("Opentrons API initialized")
return thread_manager
Expand Down

0 comments on commit 5343b36

Please sign in to comment.