From d11a1286bdc11dab62a65fd6d972043f109ab2fe Mon Sep 17 00:00:00 2001 From: Tim-Oliver Husser Date: Mon, 5 Aug 2024 10:18:01 +0200 Subject: [PATCH] added groups --- pyobs/interfaces/IMode.py | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/pyobs/interfaces/IMode.py b/pyobs/interfaces/IMode.py index 5739e292..bded942a 100644 --- a/pyobs/interfaces/IMode.py +++ b/pyobs/interfaces/IMode.py @@ -9,21 +9,34 @@ class IMode(Interface, metaclass=ABCMeta): __module__ = "pyobs.interfaces" + async def list_mode_groups(self) -> List[str]: + """List names of mode groups that can be set. The index is used as the `group` parameter in the individual + methods. + + Returns: + List of names of mode groups. + """ + return [] + @abstractmethod - async def list_modes(self, **kwargs: Any) -> List[str]: + async def list_modes(self, group: int = 0, **kwargs: Any) -> List[str]: """List available modes. + Args: + group: Group number + Returns: List of available modes. """ ... @abstractmethod - async def set_mode(self, mode: str, **kwargs: Any) -> None: + async def set_mode(self, mode: str, group: int = 0, **kwargs: Any) -> None: """Set the current mode. Args: mode: Name of mode to set. + group: Group number Raises: ValueError: If an invalid mode was given. @@ -32,9 +45,12 @@ async def set_mode(self, mode: str, **kwargs: Any) -> None: ... @abstractmethod - async def get_mode(self, **kwargs: Any) -> str: + async def get_mode(self, group: int = 0, **kwargs: Any) -> str: """Get currently set mode. + Args: + group: Group number + Returns: Name of currently set mode. """