akkudoktoreos.devices.devicesabc.DevicesStartEndMixin

class akkudoktoreos.devices.devicesabc.DevicesStartEndMixin

Bases: ConfigMixin, EnergyManagementSystemMixin

A mixin to manage start, end datetimes for devices data.

The starting datetime for devices data generation is provided by the energy management system. Device data cannot be computed if this value is None.

__init__()

Methods

__init__()

Attributes

config

Convenience method/ attribute to retrieve the EOS configuration data.

ems

Convenience method/ attribute to retrieve the EOS energy management system.

end_datetime

Compute the end datetime based on the start_datetime and hours.

total_hours

Compute the hours from start_datetime to end_datetime.

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]

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]

property config: Any

Convenience method/ attribute to retrieve the EOS configuration data.

Returns:

The configuration.

Return type:

ConfigEOS

property ems: Any

Convenience method/ attribute to retrieve the EOS energy management system.

Returns:

The energy management system.

Return type:

EnergyManagementSystem