Skip to content

Commit

Permalink
Improve DomeController.stop()
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Jan 15, 2024
1 parent dad8ebd commit 228b004
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions python/lvmecp/dome.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,11 @@ async def close(self, force: bool = False):
async def stop(self):
"""Stops the dome."""

drive_enabled = await self.plc.modbus["drive_enabled"].get()
status = await self.update()

if status is None or self.flag is None:
raise RuntimeError("Failed retrieving dome status.")

drive_enabled = bool(status & self.flag.DRIVE_ENABLED)
if not drive_enabled:
return

Expand Down

0 comments on commit 228b004

Please sign in to comment.