Skip to content

Commit

Permalink
fix(robot-server): fix robot-server blinker task startup causing hw i…
Browse files Browse the repository at this point in the history
…nit failure on the Flex. (#16483)
  • Loading branch information
vegano1 authored Oct 16, 2024
1 parent 6424725 commit e3dc8d7
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion robot-server/robot_server/hardware.py
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,19 @@ async def start_blinking(self, hardware: HardwareControlAPI) -> None:
Blinking will continue until `mark_hardware_init_complete()` and
`mark_persistence_init_complete()` have both been called.
"""
if should_use_ot3():
# Dont run this task on the Flex because,
# 1. There is no front button blinker on the Flex
# 2. The Flex raises an error when attempting to turn on the lights
# while there is a system firmware update in progress. This causes
# the hardware controller to fail initialization, leaving the
# robot server in a bad state.
return

assert self._hardware_and_task is None, "hardware should only be set once."

async def blink_forever() -> None:
while True:
# This should no-op on a Flex.
await hardware.set_lights(button=True)
await asyncio.sleep(0.5)
await hardware.set_lights(button=False)
Expand Down

0 comments on commit e3dc8d7

Please sign in to comment.