connection_manager
frequenz.sdk.microgrid.connection_manager
¤
Microgrid Connection Manager singleton abstraction.
This module provides a singleton abstraction over the microgrid. The main purpose is to provide the connection the microgrid API client and the microgrid component graph.
Classes¤
frequenz.sdk.microgrid.connection_manager.ConnectionManager
¤
Bases: ABC
Creates and stores core features.
Source code in /opt/hostedtoolcache/Python/3.11.5/x64/lib/python3.11/site-packages/frequenz/sdk/microgrid/connection_manager.py
Attributes¤
api_client: MicrogridApiClient
abstractmethod
property
¤
Get MicrogridApiClient.
RETURNS | DESCRIPTION |
---|---|
MicrogridApiClient
|
api client |
component_graph: ComponentGraph
abstractmethod
property
¤
Get component graph.
RETURNS | DESCRIPTION |
---|---|
ComponentGraph
|
component graph |
Functions¤
Functions¤
frequenz.sdk.microgrid.connection_manager.get()
¤
Get the MicrogridApi instance created by initialize().
This function should be only called after initialize().
RAISES | DESCRIPTION |
---|---|
RuntimeError
|
Raised when:
* If |
RETURNS | DESCRIPTION |
---|---|
ConnectionManager
|
MicrogridApi instance. |
Source code in /opt/hostedtoolcache/Python/3.11.5/x64/lib/python3.11/site-packages/frequenz/sdk/microgrid/connection_manager.py
frequenz.sdk.microgrid.connection_manager.initialize(host, port)
async
¤
Initialize the MicrogridApi. This function should be called only once.
PARAMETER | DESCRIPTION |
---|---|
host |
Microgrid host
TYPE:
|
port |
Microgrid port
TYPE:
|
RAISES | DESCRIPTION |
---|---|
AssertionError
|
If method was called more then once. |