Add websocket API to update config entry title (#34155)

This commit is contained in:
Paulus Schoutsen 2020-04-13 17:38:39 -07:00 committed by GitHub
parent 5ddcc22583
commit 89fe488b7c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 74 additions and 24 deletions

View file

@ -614,6 +614,29 @@ async def test_update_system_options(hass, hass_ws_client):
assert entry.system_options.disable_new_entities
async def test_update_entry(hass, hass_ws_client):
"""Test that we can update entry."""
assert await async_setup_component(hass, "config", {})
ws_client = await hass_ws_client(hass)
entry = MockConfigEntry(domain="demo", title="Initial Title")
entry.add_to_hass(hass)
await ws_client.send_json(
{
"id": 5,
"type": "config_entries/update",
"entry_id": entry.entry_id,
"title": "Updated Title",
}
)
response = await ws_client.receive_json()
assert response["success"]
assert response["result"]["title"] == "Updated Title"
assert entry.title == "Updated Title"
async def test_ignore_flow(hass, hass_ws_client):
"""Test we can ignore a flow."""
assert await async_setup_component(hass, "config", {})