akkudoktoreos.devices.devices.Devices
- class akkudoktoreos.devices.devices.Devices(*args: Any, **kwargs: Any)
Bases:
SingletonMixin,DevicesBase- __init__(settings: DevicesCommonSettings | None = None)
Initializes the singleton instance if it has not been initialized previously.
Further calls to __init__ are ignored for the singleton instance.
- Parameters:
*args – Positional arguments for initialization.
**kwargs – Keyword arguments for initialization.
Methods
__init__([settings])Initializes the singleton instance if it has not been initialized previously.
add_device(device)get_device_by_id(device_id)remove_device(device)reset()Resets the singleton instance, forcing it to be recreated on next access.
Attributes
Convenience method/ attribute to retrieve the EOS configuration data.
Convenience method/ attribute to retrieve the EOS energy management system.
Compute the end datetime based on the start_datetime and hours.
Convenience method/ attribute to retrieve the EOS prediction data.
Compute the hours from start_datetime to end_datetime.
- __init__(settings: DevicesCommonSettings | None = None)
Initializes the singleton instance if it has not been initialized previously.
Further calls to __init__ are ignored for the singleton instance.
- Parameters:
*args – Positional arguments for initialization.
**kwargs – Keyword arguments for initialization.
- post_setup() None
- static __new__(cls: Type[SingletonMixin], *args: Any, **kwargs: Any) SingletonMixin
Creates or returns the singleton instance of the class.
Ensures thread-safe instance creation by locking during the first instantiation.
- Parameters:
*args – Positional arguments for instance creation (ignored if instance exists).
**kwargs – Keyword arguments for instance creation (ignored if instance exists).
- Returns:
The singleton instance of the derived class.
- Return type:
- add_device(device: DeviceBase | None) None
- property config: Any
Convenience method/ attribute to retrieve the EOS configuration data.
- Returns:
The configuration.
- Return type:
- property ems: Any
Convenience method/ attribute to retrieve the EOS energy management system.
- Returns:
The energy management system.
- Return type:
EnergyManagementSystem
- property end_datetime: DateTime | None
Compute the end datetime based on the start_datetime and hours.
Ajusts the calculated end time if DST transitions occur within the prediction window.
- Returns:
The calculated end datetime, or None if inputs are missing.
- Return type:
Optional[DateTime]
- get_device_by_id(device_id: str) DeviceBase | None
- property prediction: Any
Convenience method/ attribute to retrieve the EOS prediction data.
- Returns:
The prediction.
- Return type:
- remove_device(device: Type[DeviceBase] | str) bool
- reset() None
- classmethod reset_instance() None
Resets the singleton instance, forcing it to be recreated on next access.
- property total_hours: int | None
Compute the hours from start_datetime to end_datetime.
- Returns:
The duration hours, or None if either datetime is unavailable.
- Return type:
Optional[pendulum.period]