akkudoktoreos.core.coreabc.get_adapter

akkudoktoreos.core.coreabc.get_adapter(init: bool = False) Adapter

Retrieve the singleton EOS Adapter instance.

This function provides access to the global EOS Adapter instance. The Adapter object is created on first access if init is True. If the instance is accessed before initialization and init is False, a RuntimeError is raised.

Parameters:

init (bool) – If True, create the Adapter instance if it does not exist. Default is False.

Returns:

The global EOS Adapter instance.

Return type:

Adapter

Raises:

RuntimeError – If accessed before initialization with init=False.

Usage:
adapter = get_adapter(init=True)  # Initialize and retrieve
adapter.do_something()