From c266fcbd967682b222844b515730a15900ade161 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20S=C3=A1nchez-Gallego?= Date: Tue, 26 Nov 2024 03:30:40 +0000 Subject: [PATCH] Add reporting of roll-off error state and allow resetting on error --- CHANGELOG.md | 7 +++++++ python/lvmecp/actor/commands/dome.py | 12 ++++++++++++ python/lvmecp/dome.py | 6 ++++++ python/lvmecp/etc/lvmecp.yml | 9 +++++---- 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8198813..36316bc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +## Next version + +### ✨ Improved + +* Add reporting of roll-off error state and allow resetting on error. + + ## 0.8.4 - November 3, 2024 ### ✨ Improved diff --git a/python/lvmecp/actor/commands/dome.py b/python/lvmecp/actor/commands/dome.py index edb7b8b..965c482 100644 --- a/python/lvmecp/actor/commands/dome.py +++ b/python/lvmecp/actor/commands/dome.py @@ -95,3 +95,15 @@ async def stop(command: ECPCommand): await command.actor.plc.dome.stop() return command.finish() + + +@dome.command() +async def reset(command: ECPCommand, force=False): + """Resets dome error state.""" + + try: + await command.actor.plc.dome.reset() + except DomeError as err: + return command.fail(err) + + return command.finish() diff --git a/python/lvmecp/dome.py b/python/lvmecp/dome.py index cb1940b..84c1a01 100644 --- a/python/lvmecp/dome.py +++ b/python/lvmecp/dome.py @@ -166,3 +166,9 @@ async def stop(self): await self.plc.modbus["drive_enabled"].set(False) await self.update(use_cache=False) + + async def reset(self): + """Resets the roll-off error state.""" + + await self.modbus["rolloff_error_reset"].set(1) + await asyncio.sleep(1) diff --git a/python/lvmecp/etc/lvmecp.yml b/python/lvmecp/etc/lvmecp.yml index dea5a96..152eb6a 100644 --- a/python/lvmecp/etc/lvmecp.yml +++ b/python/lvmecp/etc/lvmecp.yml @@ -114,13 +114,14 @@ modbus: address: 149 mode: holding_register group: dome - dome_status1: + rolloff_lockout: address: 410 - mode: holding_register group: dome - dome_status2: + rolloff_error: address: 411 - mode: holding_register + group: dome + rolloff_error_reset: + address: 412 group: dome oxygen_read_utilities_room: address: 599