akkudoktoreos.core.coreabc.get_ems

akkudoktoreos.core.coreabc.get_ems(init: bool = False) EnergyManagement

Retrieve the singleton EOS Energy Management System (EMS) instance.

This function provides access to the global EOS EMS instance. The instance 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 EMS instance if it does not exist. Default is False.

Returns:

The global EOS EMS instance.

Return type:

EnergyManagement

Raises:

RuntimeError – If accessed before initialization with init=False.

Usage:
ems = get_ems(init=True)  # Initialize and retrieve
ems.start_energy_management_loop()