182 files

This commit is contained in:
Home Assistant Version Control
2026-08-17 12:11:35 +00:00
parent 7dddf6bb13
commit ece15a1c1b
183 changed files with 11457 additions and 3092 deletions
@@ -26,6 +26,7 @@ from .const import (
HistoryEntryType,
ScheduleType,
)
from .helpers.aggregate import object_name
from .helpers.schedule import (
FLAT_RECURRENCE_KEYS,
normalize_task_storage,
@@ -587,28 +588,24 @@ class StaleActionEntityRepairFlow(RepairsFlow):
return _entry_for_issue(self.hass, self.data)
def _patch_action_entity(self, entry: Any, new_entity_id: str) -> None:
from .helpers.entry_tasks import write_task
task_id = str((self.data or {}).get("task_id", ""))
new_data = dict(entry.data)
tasks = dict(new_data.get(CONF_TASKS, {}))
task = dict(tasks.get(task_id) or {})
task = dict(entry.data.get(CONF_TASKS, {}).get(task_id) or {})
action = dict(task.get("on_complete_action") or {})
target = dict(action.get("target") or {})
target["entity_id"] = new_entity_id
action["target"] = target
task["on_complete_action"] = action
tasks[task_id] = task
new_data[CONF_TASKS] = tasks
self.hass.config_entries.async_update_entry(entry, data=new_data)
write_task(self.hass, entry, task_id, task)
def _clear_action(self, entry: Any) -> None:
from .helpers.entry_tasks import write_task
task_id = str((self.data or {}).get("task_id", ""))
new_data = dict(entry.data)
tasks = dict(new_data.get(CONF_TASKS, {}))
task = dict(tasks.get(task_id) or {})
task = dict(entry.data.get(CONF_TASKS, {}).get(task_id) or {})
task.pop("on_complete_action", None)
tasks[task_id] = task
new_data[CONF_TASKS] = tasks
self.hass.config_entries.async_update_entry(entry, data=new_data)
write_task(self.hass, entry, task_id, task)
class DocumentStorageRepairFlow(RepairsFlow):
@@ -732,12 +729,9 @@ class DeviceLinkRepairFlow(RepairsFlow):
# ── helpers ──────────────────────────────────────────────────────────
def _placeholders(self, entry: Any) -> dict[str, str]:
from .const import CONF_OBJECT
obj = entry.data.get(CONF_OBJECT, {}) or {}
best = self._best_match(entry)
return {
"object": str(obj.get("name") or entry.title),
"object": object_name(entry),
"suggestion": str((best.name_by_user or best.name) if best else ""),
}