mirror of
https://github.com/elisspace/core.git
synced 2026-10-01 06:49:55 +00:00
Fix zwave_js manual reconfiguration of add-on managed entry (#47364)
This commit is contained in:
@@ -184,7 +184,16 @@ async def test_manual_errors(
|
||||
|
||||
async def test_manual_already_configured(hass):
|
||||
"""Test that only one unique instance is allowed."""
|
||||
entry = MockConfigEntry(domain=DOMAIN, data={}, title=TITLE, unique_id=1234)
|
||||
entry = MockConfigEntry(
|
||||
domain=DOMAIN,
|
||||
data={
|
||||
"url": "ws://localhost:3000",
|
||||
"use_addon": True,
|
||||
"integration_created_addon": True,
|
||||
},
|
||||
title=TITLE,
|
||||
unique_id=1234,
|
||||
)
|
||||
entry.add_to_hass(hass)
|
||||
|
||||
await setup.async_setup_component(hass, "persistent_notification", {})
|
||||
@@ -198,12 +207,15 @@ async def test_manual_already_configured(hass):
|
||||
result = await hass.config_entries.flow.async_configure(
|
||||
result["flow_id"],
|
||||
{
|
||||
"url": "ws://localhost:3000",
|
||||
"url": "ws://1.1.1.1:3001",
|
||||
},
|
||||
)
|
||||
|
||||
assert result["type"] == "abort"
|
||||
assert result["reason"] == "already_configured"
|
||||
assert entry.data["url"] == "ws://1.1.1.1:3001"
|
||||
assert entry.data["use_addon"] is False
|
||||
assert entry.data["integration_created_addon"] is False
|
||||
|
||||
|
||||
@pytest.mark.parametrize("discovery_info", [{"config": ADDON_DISCOVERY_INFO}])
|
||||
|
||||
Reference in New Issue
Block a user