Skip to content

Commit 8af7dc5

Browse files
committed
test: pass identifier on ha_config_set_automation create calls
The tool rejects calls that put 'id' in config without also passing identifier (would create a duplicate). Drop the redundant 'id' field and pass identifier explicitly on both create and edit paths.
1 parent 3b46f89 commit 8af7dc5

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

tests/src/e2e/workflows/auto_backup/test_capture_and_restore.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -130,14 +130,16 @@ async def test_full_loop(self, mcp_client, monkeypatch: pytest.MonkeyPatch) -> N
130130
suffix = uuid.uuid4().hex[:8]
131131
identifier = f"e2e_backup_{suffix}"
132132
original = {
133-
"id": identifier,
134133
"alias": f"E2E Backup Original {suffix}",
135134
"trigger": [{"platform": "time", "at": "12:00:00"}],
136135
"action": [{"service": "homeassistant.no_op"}],
137136
}
138-
# Create
137+
# Create — pass identifier so the tool doesn't reject the call as
138+
# an ambiguous create-with-explicit-id.
139139
create = await safe_call_tool(
140-
mcp_client, "ha_config_set_automation", {"config": original}
140+
mcp_client,
141+
"ha_config_set_automation",
142+
{"config": original, "identifier": identifier},
141143
)
142144
assert create.get("success") is not False
143145

@@ -433,19 +435,18 @@ async def test_disabled_means_no_new_backups(
433435
"ha_config_set_automation",
434436
{
435437
"config": {
436-
"id": identifier,
437438
"alias": "Auto off test",
438439
"trigger": [{"platform": "time", "at": "12:00:00"}],
439440
"action": [{"service": "homeassistant.no_op"}],
440-
}
441+
},
442+
"identifier": identifier,
441443
},
442444
)
443445
await safe_call_tool(
444446
mcp_client,
445447
"ha_config_set_automation",
446448
{
447449
"config": {
448-
"id": identifier,
449450
"alias": "Auto off test edited",
450451
"trigger": [{"platform": "time", "at": "12:00:00"}],
451452
"action": [{"service": "homeassistant.no_op"}],

0 commit comments

Comments
 (0)