Skip to content

Setup actions

Mixin for components that expose interactive setup actions.

HasSetupFunctionsMixin

Mixin for classes that provide setup/calibration functions.

Classes using this mixin can expose named actions to the interactive setup utility. Override setup_functions to return a dict of available actions.

Source code in pt/controller_3/src/plant_controller/setup_actions.py
class HasSetupFunctionsMixin:
    """Mixin for classes that provide setup/calibration functions.

    Classes using this mixin can expose named actions to the interactive
    setup utility. Override ``setup_functions`` to return a dict of
    available actions.
    """

    def setup_functions(self) -> dict[str, dict[str, Any]]:
        """Return available setup actions for this component.

        Returns:
            Dict mapping action names to dicts with keys:
                - 'description' (str): Human-readable description.
                - 'function' (async callable): The setup coroutine to run.
            Returns empty dict if no setup actions are available.
        """
        return {}

setup_functions()

Return available setup actions for this component.

Returns:

Type Description
dict[str, dict[str, Any]]

Dict mapping action names to dicts with keys: - 'description' (str): Human-readable description. - 'function' (async callable): The setup coroutine to run.

dict[str, dict[str, Any]]

Returns empty dict if no setup actions are available.

Source code in pt/controller_3/src/plant_controller/setup_actions.py
def setup_functions(self) -> dict[str, dict[str, Any]]:
    """Return available setup actions for this component.

    Returns:
        Dict mapping action names to dicts with keys:
            - 'description' (str): Human-readable description.
            - 'function' (async callable): The setup coroutine to run.
        Returns empty dict if no setup actions are available.
    """
    return {}