Skip to content

Commit

Permalink
Fix bug in LCO lamps
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Jan 31, 2024
1 parent 2d0ac8f commit 2e70711
Showing 1 changed file with 19 additions and 20 deletions.
39 changes: 19 additions & 20 deletions src/hal/helpers/lamps.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,23 +301,22 @@ async def turn_lamp(
if status[ll][0] is not False:
turn_off_tasks.append(self._command_one(command, ll, False))

if len(turn_off_tasks) > 0:
try:
if len(turn_off_tasks) > 0:
await asyncio.gather(*turn_off_tasks)

await asyncio.gather(*tasks)
except Exception as err:
if is_retry:
raise
else:
command.warning(f"Failed commanding lamps: {err}")
command.warning("Retrying lamps.")
return await self.turn_lamp(
command,
lamps,
state,
turn_off_others=turn_off_others,
delay=delay,
is_retry=True,
)
try:
if len(turn_off_tasks) > 0:
await asyncio.gather(*turn_off_tasks)

await asyncio.gather(*tasks)
except Exception as err:
if is_retry:
raise
else:
command.warning(f"Failed commanding lamps: {err}")
command.warning("Retrying lamps.")
return await self.turn_lamp(
command,
lamps,
state,
turn_off_others=turn_off_others,
delay=delay,
is_retry=True,
)

0 comments on commit 2e70711

Please sign in to comment.