182 files
This commit is contained in:
@@ -18,6 +18,7 @@ from ..const import (
|
||||
MAX_CHECKLIST_ITEM_LENGTH,
|
||||
MAX_CHECKLIST_ITEMS,
|
||||
)
|
||||
from .aggregate import merged_tasks
|
||||
from .dates import INTERVAL_UNITS
|
||||
from .global_options import get_default_warning_days
|
||||
from .schedule import read_legacy_fields
|
||||
@@ -33,6 +34,11 @@ _COLUMNS = [
|
||||
"object_area_id",
|
||||
"object_installation_date",
|
||||
"object_warranty_expiry",
|
||||
# The 2026-08 round-trip audit: the IMPORT read these two from day one,
|
||||
# but the export never wrote the columns — a CSV migration silently
|
||||
# dropped object notes + documentation URL.
|
||||
"object_documentation_url",
|
||||
"object_notes",
|
||||
"task_name",
|
||||
"task_type",
|
||||
"enabled",
|
||||
@@ -83,10 +89,7 @@ def export_objects_csv(hass: HomeAssistant, entry_ids: set[str] | None = None) -
|
||||
for entry in entries:
|
||||
obj_data = entry.data.get(CONF_OBJECT, {})
|
||||
# Merge static + Store dynamic data
|
||||
rd = getattr(entry, "runtime_data", None)
|
||||
store = getattr(rd, "store", None) if rd 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)
|
||||
|
||||
rd = getattr(entry, "runtime_data", None)
|
||||
coord_data = rd.coordinator.data if rd and rd.coordinator else None
|
||||
@@ -104,6 +107,8 @@ def export_objects_csv(hass: HomeAssistant, entry_ids: set[str] | None = None) -
|
||||
"object_area_id": _csv_safe(obj_data.get("area_id", "")),
|
||||
"object_installation_date": _csv_safe(obj_data.get("installation_date", "")),
|
||||
"object_warranty_expiry": _csv_safe(obj_data.get("warranty_expiry", "")),
|
||||
"object_documentation_url": _csv_safe(obj_data.get("documentation_url") or ""),
|
||||
"object_notes": _csv_safe(obj_data.get("notes") or ""),
|
||||
"task_name": _csv_safe(tdata.get("name", "")),
|
||||
"task_type": tdata.get("type", "custom"),
|
||||
"enabled": tdata.get("enabled", True),
|
||||
@@ -169,10 +174,7 @@ def export_object_records_csv(hass: HomeAssistant, entry_ids: set[str] | None =
|
||||
|
||||
for entry in entries:
|
||||
obj_data = entry.data.get(CONF_OBJECT, {})
|
||||
static_tasks = entry.data.get(CONF_TASKS, {})
|
||||
rd = getattr(entry, "runtime_data", None)
|
||||
store = getattr(rd, "store", None) if rd else None
|
||||
tasks_data = store.merge_all_tasks(static_tasks) if store is not None else static_tasks
|
||||
tasks_data = merged_tasks(entry)
|
||||
writer.writerow(
|
||||
{
|
||||
"object_name": _csv_safe(obj_data.get("name", "")),
|
||||
|
||||
Reference in New Issue
Block a user