diff --git a/python/lvmecp/actor/actor.py b/python/lvmecp/actor/actor.py index efbd4c3..04fb388 100644 --- a/python/lvmecp/actor/actor.py +++ b/python/lvmecp/actor/actor.py @@ -120,12 +120,14 @@ async def monitor_dome(self, delay: float = 30.0): if self._engineering_mode: pass elif self.plc.dome.is_daytime() and not is_closing: - self.write("w", text="Dome found open during daytime. Closing.") - await send_notification( - "Dome found open during daytime. Closing.", - level="warning", - ) - await self.plc.dome.close() + try: + self.write("w", text="Dome found open during daytime. Closing.") + await send_notification( + "Dome found open during daytime. Closing.", + level="warning", + ) + finally: + await self.plc.dome.close() async def engineering_mode( self,