akkudoktoreos.core.coreabc.AdapterMixin

class akkudoktoreos.core.coreabc.AdapterMixin

Bases: object

Mixin class for managing EOS adapter.

This class serves as a foundational component for EOS-related classes requiring access to the global EOS adapters. It provides a adapter property that dynamically retrieves the adapter instance.

Usage:

Subclass this base class to gain access to the adapter attribute, which retrieves the global adapter instance lazily to avoid import-time circular dependencies.

adapter

Property to access the global EOS adapter.

Type:

Adapter

Example

class MyEOSClass(AdapterMixin):
    def my_method(self):
        self.adapter.update_date()
__init__()

Methods

__init__()

Attributes

adapter

adapter = Adapter(providers=[HomeAssistantAdapter(update_datetime=None), NodeREDAdapter(update_datetime=None)])