Skip to content

Commit

Permalink
Use LVMActor
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Mar 26, 2024
1 parent fa39464 commit 8dc9133
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### 🚀 New

* Allow not outputting the registers in `status` with `--no-registers`.
* Use `LVMActor` as the base class for the ECP actor.


## 0.7.0 - January 19, 2024
Expand Down
22 changes: 21 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ sdss-clu = "^2.1.0"
click-default-group = "^1.2.2"
pyserial-asyncio = "^0.6"
pymodbus = "3.6.2"
lvmopstools = "^0.2.0"

[tool.poetry.group.dev.dependencies]
ipython = ">=7.11.0"
Expand Down
15 changes: 13 additions & 2 deletions python/lvmecp/actor/actor.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
import asyncio
import logging

from clu.actor import AMQPActor
from lvmopstools.actor import ErrorCodesBase, LVMActor

from clu.tools import ActorHandler

from lvmecp import __version__, log
Expand All @@ -23,7 +24,7 @@
__all__ = ["ECPActor"]


class ECPActor(AMQPActor):
class ECPActor(LVMActor):
"""Enclosure actor."""

parser = parser
Expand Down Expand Up @@ -82,3 +83,13 @@ async def emit_heartbeat(self, delay: float = 5.0):
self.write("w", "Failed to set heartbeat variable.")
finally:
await asyncio.sleep(delay)

async def _check_internal(self):
return await super()._check_internal()

async def _troubleshoot_internal(
self,
error_code: ErrorCodesBase,
exception: Exception | None = None,
):
return await super()._troubleshoot_internal(error_code, exception)

0 comments on commit 8dc9133

Please sign in to comment.