From 228b0044a30eb5fb620644f42116d1c7b0cb0bcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20S=C3=A1nchez-Gallego?= Date: Mon, 15 Jan 2024 20:03:38 +0000 Subject: [PATCH] Improve DomeController.stop() --- python/lvmecp/dome.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/python/lvmecp/dome.py b/python/lvmecp/dome.py index 3880b90..40d418b 100644 --- a/python/lvmecp/dome.py +++ b/python/lvmecp/dome.py @@ -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