456 files

This commit is contained in:
Home Assistant Version Control
2026-10-01 05:38:21 +00:00
parent 4192ecbaae
commit 5d6d845ebf
456 changed files with 64951 additions and 3828 deletions
@@ -41,6 +41,9 @@ class SpookService(AbstractSpookAdminService):
0
].__self__.storage_collection
# Everything is looked up before anything is written. A bad one late
# in the list should not leave the first ones changed behind an error.
zone_ids = []
for entity_id in call.data["entity_id"]:
if not (entity := entity_component.get_entity(entity_id)):
message = f"Could not find entity_id: {entity_id}"
@@ -52,4 +55,9 @@ class SpookService(AbstractSpookAdminService):
raise HomeAssistantError(message)
# pylint: disable-next=protected-access
await collection.async_delete_item(entity._config["id"]) # noqa: SLF001
zone_ids.append(entity._config["id"]) # noqa: SLF001
# The same zone twice in the list is still one zone. Deleting it a
# second time would fail after the first had already gone through.
for zone_id in dict.fromkeys(zone_ids):
await collection.async_delete_item(zone_id)