Skip to content

Commit

Permalink
added groups
Browse files Browse the repository at this point in the history
  • Loading branch information
thusser committed Aug 5, 2024
1 parent 5b0692c commit d11a128
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions pyobs/interfaces/IMode.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
"""
Expand Down

0 comments on commit d11a128

Please sign in to comment.