182 files
This commit is contained in:
@@ -12,7 +12,6 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.util import dt as dt_util
|
||||
|
||||
from .const import (
|
||||
CONF_ADVANCED_SCHEDULE_TIME,
|
||||
CONF_OBJECT,
|
||||
CONF_TASKS,
|
||||
DOMAIN,
|
||||
@@ -20,7 +19,9 @@ from .const import (
|
||||
MaintenanceStatus,
|
||||
ScheduleType,
|
||||
)
|
||||
from .helpers.aggregate import merged_tasks
|
||||
from .helpers.dates import interval_span_days
|
||||
from .helpers.global_options import is_schedule_time_enabled
|
||||
from .helpers.i18n import normalize_language
|
||||
from .models.maintenance_task import MaintenanceTask
|
||||
|
||||
@@ -521,9 +522,7 @@ class MaintenanceCalendar(CalendarEntity):
|
||||
live_tasks = {}
|
||||
|
||||
# Merge static (ConfigEntry) + dynamic (Store) task data
|
||||
store = getattr(runtime_data, "store", None) if runtime_data else None
|
||||
static_tasks = entry.data.get(CONF_TASKS, {})
|
||||
tasks_data = store.merge_all_tasks(static_tasks) if store is not None else static_tasks
|
||||
tasks_data = merged_tasks(entry)
|
||||
|
||||
for task_id, task_dict in tasks_data.items():
|
||||
task = MaintenanceTask.from_dict(task_dict)
|
||||
@@ -638,9 +637,5 @@ class MaintenanceCalendar(CalendarEntity):
|
||||
)
|
||||
|
||||
def _is_schedule_time_feature_enabled(self) -> bool:
|
||||
"""Lookup the global advanced flag — same approach as coordinator."""
|
||||
for ce in self._hass.config_entries.async_entries(DOMAIN):
|
||||
if ce.unique_id == GLOBAL_UNIQUE_ID:
|
||||
opts = ce.options or ce.data
|
||||
return bool(opts.get(CONF_ADVANCED_SCHEDULE_TIME, False))
|
||||
return False
|
||||
"""Lookup the global advanced flag — same source as the coordinator."""
|
||||
return is_schedule_time_enabled(self._hass)
|
||||
|
||||
Reference in New Issue
Block a user