mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
Fix title of Matter integration (#84385)
* Set title for Matter integration to integration name * Update homeassistant/components/matter/config_flow.py Co-authored-by: Franck Nijhof <git@frenck.dev> * Update title in tests * one more title fix Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
parent
53637d486d
commit
cdeb91ea12
@ -34,6 +34,7 @@ from .const import (
|
|||||||
ADDON_SETUP_TIMEOUT = 5
|
ADDON_SETUP_TIMEOUT = 5
|
||||||
ADDON_SETUP_TIMEOUT_ROUNDS = 40
|
ADDON_SETUP_TIMEOUT_ROUNDS = 40
|
||||||
DEFAULT_URL = "ws://localhost:5580/ws"
|
DEFAULT_URL = "ws://localhost:5580/ws"
|
||||||
|
DEFAULT_TITLE = "Matter"
|
||||||
ON_SUPERVISOR_SCHEMA = vol.Schema({vol.Optional(CONF_USE_ADDON, default=True): bool})
|
ON_SUPERVISOR_SCHEMA = vol.Schema({vol.Optional(CONF_USE_ADDON, default=True): bool})
|
||||||
|
|
||||||
|
|
||||||
@ -306,7 +307,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
|||||||
CONF_USE_ADDON: self.use_addon,
|
CONF_USE_ADDON: self.use_addon,
|
||||||
CONF_INTEGRATION_CREATED_ADDON: self.integration_created_addon,
|
CONF_INTEGRATION_CREATED_ADDON: self.integration_created_addon,
|
||||||
},
|
},
|
||||||
title=self.ws_address,
|
title=DEFAULT_TITLE,
|
||||||
)
|
)
|
||||||
await self.hass.config_entries.async_reload(config_entry.entry_id)
|
await self.hass.config_entries.async_reload(config_entry.entry_id)
|
||||||
raise AbortFlow("reconfiguration_successful")
|
raise AbortFlow("reconfiguration_successful")
|
||||||
@ -316,7 +317,7 @@ class ConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
|
|||||||
self.hass.config_entries.flow.async_abort(progress["flow_id"])
|
self.hass.config_entries.flow.async_abort(progress["flow_id"])
|
||||||
|
|
||||||
return self.async_create_entry(
|
return self.async_create_entry(
|
||||||
title=self.ws_address,
|
title=DEFAULT_TITLE,
|
||||||
data={
|
data={
|
||||||
CONF_URL: self.ws_address,
|
CONF_URL: self.ws_address,
|
||||||
CONF_USE_ADDON: self.use_addon,
|
CONF_USE_ADDON: self.use_addon,
|
||||||
|
@ -99,7 +99,7 @@ async def test_manual_create_entry(
|
|||||||
|
|
||||||
assert client_connect.call_count == 1
|
assert client_connect.call_count == 1
|
||||||
assert result["type"] == FlowResultType.CREATE_ENTRY
|
assert result["type"] == FlowResultType.CREATE_ENTRY
|
||||||
assert result["title"] == "ws://localhost:5580/ws"
|
assert result["title"] == "Matter"
|
||||||
assert result["data"] == {
|
assert result["data"] == {
|
||||||
"url": "ws://localhost:5580/ws",
|
"url": "ws://localhost:5580/ws",
|
||||||
"integration_created_addon": False,
|
"integration_created_addon": False,
|
||||||
@ -172,7 +172,7 @@ async def test_manual_already_configured(
|
|||||||
assert entry.data["url"] == "ws://localhost:5580/ws"
|
assert entry.data["url"] == "ws://localhost:5580/ws"
|
||||||
assert entry.data["use_addon"] is False
|
assert entry.data["use_addon"] is False
|
||||||
assert entry.data["integration_created_addon"] is False
|
assert entry.data["integration_created_addon"] is False
|
||||||
assert entry.title == "ws://localhost:5580/ws"
|
assert entry.title == "Matter"
|
||||||
assert setup_entry.call_count == 1
|
assert setup_entry.call_count == 1
|
||||||
|
|
||||||
|
|
||||||
@ -202,7 +202,7 @@ async def test_supervisor_discovery(
|
|||||||
assert addon_info.call_count == 1
|
assert addon_info.call_count == 1
|
||||||
assert client_connect.call_count == 0
|
assert client_connect.call_count == 0
|
||||||
assert result["type"] == FlowResultType.CREATE_ENTRY
|
assert result["type"] == FlowResultType.CREATE_ENTRY
|
||||||
assert result["title"] == "ws://host1:5581/ws"
|
assert result["title"] == "Matter"
|
||||||
assert result["data"] == {
|
assert result["data"] == {
|
||||||
"url": "ws://host1:5581/ws",
|
"url": "ws://host1:5581/ws",
|
||||||
"use_addon": True,
|
"use_addon": True,
|
||||||
@ -294,7 +294,7 @@ async def test_clean_supervisor_discovery_on_user_create(
|
|||||||
assert len(hass.config_entries.flow.async_progress()) == 0
|
assert len(hass.config_entries.flow.async_progress()) == 0
|
||||||
assert client_connect.call_count == 1
|
assert client_connect.call_count == 1
|
||||||
assert result["type"] == FlowResultType.CREATE_ENTRY
|
assert result["type"] == FlowResultType.CREATE_ENTRY
|
||||||
assert result["title"] == "ws://localhost:5580/ws"
|
assert result["title"] == "Matter"
|
||||||
assert result["data"] == {
|
assert result["data"] == {
|
||||||
"url": "ws://localhost:5580/ws",
|
"url": "ws://localhost:5580/ws",
|
||||||
"use_addon": False,
|
"use_addon": False,
|
||||||
@ -313,7 +313,7 @@ async def test_abort_supervisor_discovery_with_existing_entry(
|
|||||||
entry = MockConfigEntry(
|
entry = MockConfigEntry(
|
||||||
domain=DOMAIN,
|
domain=DOMAIN,
|
||||||
data={"url": "ws://localhost:5580/ws"},
|
data={"url": "ws://localhost:5580/ws"},
|
||||||
title="ws://localhost:5580/ws",
|
title="Matter",
|
||||||
)
|
)
|
||||||
entry.add_to_hass(hass)
|
entry.add_to_hass(hass)
|
||||||
|
|
||||||
@ -424,7 +424,7 @@ async def test_supervisor_discovery_addon_not_running(
|
|||||||
assert start_addon.call_args == call(hass, "core_matter_server")
|
assert start_addon.call_args == call(hass, "core_matter_server")
|
||||||
assert client_connect.call_count == 1
|
assert client_connect.call_count == 1
|
||||||
assert result["type"] == FlowResultType.CREATE_ENTRY
|
assert result["type"] == FlowResultType.CREATE_ENTRY
|
||||||
assert result["title"] == "ws://host1:5581/ws"
|
assert result["title"] == "Matter"
|
||||||
assert result["data"] == {
|
assert result["data"] == {
|
||||||
"url": "ws://host1:5581/ws",
|
"url": "ws://host1:5581/ws",
|
||||||
"use_addon": True,
|
"use_addon": True,
|
||||||
@ -481,7 +481,7 @@ async def test_supervisor_discovery_addon_not_installed(
|
|||||||
assert start_addon.call_args == call(hass, "core_matter_server")
|
assert start_addon.call_args == call(hass, "core_matter_server")
|
||||||
assert client_connect.call_count == 1
|
assert client_connect.call_count == 1
|
||||||
assert result["type"] == FlowResultType.CREATE_ENTRY
|
assert result["type"] == FlowResultType.CREATE_ENTRY
|
||||||
assert result["title"] == "ws://host1:5581/ws"
|
assert result["title"] == "Matter"
|
||||||
assert result["data"] == {
|
assert result["data"] == {
|
||||||
"url": "ws://host1:5581/ws",
|
"url": "ws://host1:5581/ws",
|
||||||
"use_addon": True,
|
"use_addon": True,
|
||||||
@ -521,7 +521,7 @@ async def test_not_addon(
|
|||||||
|
|
||||||
assert client_connect.call_count == 1
|
assert client_connect.call_count == 1
|
||||||
assert result["type"] == FlowResultType.CREATE_ENTRY
|
assert result["type"] == FlowResultType.CREATE_ENTRY
|
||||||
assert result["title"] == "ws://localhost:5581/ws"
|
assert result["title"] == "Matter"
|
||||||
assert result["data"] == {
|
assert result["data"] == {
|
||||||
"url": "ws://localhost:5581/ws",
|
"url": "ws://localhost:5581/ws",
|
||||||
"use_addon": False,
|
"use_addon": False,
|
||||||
@ -555,7 +555,7 @@ async def test_addon_running(
|
|||||||
assert addon_info.call_count == 1
|
assert addon_info.call_count == 1
|
||||||
assert client_connect.call_count == 1
|
assert client_connect.call_count == 1
|
||||||
assert result["type"] == FlowResultType.CREATE_ENTRY
|
assert result["type"] == FlowResultType.CREATE_ENTRY
|
||||||
assert result["title"] == "ws://host1:5581/ws"
|
assert result["title"] == "Matter"
|
||||||
assert result["data"] == {
|
assert result["data"] == {
|
||||||
"url": "ws://host1:5581/ws",
|
"url": "ws://host1:5581/ws",
|
||||||
"use_addon": True,
|
"use_addon": True,
|
||||||
@ -656,7 +656,7 @@ async def test_addon_running_already_configured(
|
|||||||
data={
|
data={
|
||||||
"url": "ws://localhost:5580/ws",
|
"url": "ws://localhost:5580/ws",
|
||||||
},
|
},
|
||||||
title="ws://localhost:5580/ws",
|
title="Matter",
|
||||||
)
|
)
|
||||||
entry.add_to_hass(hass)
|
entry.add_to_hass(hass)
|
||||||
|
|
||||||
@ -676,7 +676,7 @@ async def test_addon_running_already_configured(
|
|||||||
assert result["type"] == FlowResultType.ABORT
|
assert result["type"] == FlowResultType.ABORT
|
||||||
assert result["reason"] == "reconfiguration_successful"
|
assert result["reason"] == "reconfiguration_successful"
|
||||||
assert entry.data["url"] == "ws://host1:5581/ws"
|
assert entry.data["url"] == "ws://host1:5581/ws"
|
||||||
assert entry.title == "ws://host1:5581/ws"
|
assert entry.title == "Matter"
|
||||||
assert setup_entry.call_count == 1
|
assert setup_entry.call_count == 1
|
||||||
|
|
||||||
|
|
||||||
@ -711,7 +711,7 @@ async def test_addon_installed(
|
|||||||
|
|
||||||
assert start_addon.call_args == call(hass, "core_matter_server")
|
assert start_addon.call_args == call(hass, "core_matter_server")
|
||||||
assert result["type"] == FlowResultType.CREATE_ENTRY
|
assert result["type"] == FlowResultType.CREATE_ENTRY
|
||||||
assert result["title"] == "ws://host1:5581/ws"
|
assert result["title"] == "Matter"
|
||||||
assert result["data"] == {
|
assert result["data"] == {
|
||||||
"url": "ws://host1:5581/ws",
|
"url": "ws://host1:5581/ws",
|
||||||
"use_addon": True,
|
"use_addon": True,
|
||||||
@ -804,7 +804,7 @@ async def test_addon_installed_already_configured(
|
|||||||
data={
|
data={
|
||||||
"url": "ws://localhost:5580/ws",
|
"url": "ws://localhost:5580/ws",
|
||||||
},
|
},
|
||||||
title="ws://localhost:5580/ws",
|
title="Matter",
|
||||||
)
|
)
|
||||||
entry.add_to_hass(hass)
|
entry.add_to_hass(hass)
|
||||||
|
|
||||||
@ -831,7 +831,7 @@ async def test_addon_installed_already_configured(
|
|||||||
assert result["type"] == FlowResultType.ABORT
|
assert result["type"] == FlowResultType.ABORT
|
||||||
assert result["reason"] == "reconfiguration_successful"
|
assert result["reason"] == "reconfiguration_successful"
|
||||||
assert entry.data["url"] == "ws://host1:5581/ws"
|
assert entry.data["url"] == "ws://host1:5581/ws"
|
||||||
assert entry.title == "ws://host1:5581/ws"
|
assert entry.title == "Matter"
|
||||||
assert setup_entry.call_count == 1
|
assert setup_entry.call_count == 1
|
||||||
|
|
||||||
|
|
||||||
@ -877,7 +877,7 @@ async def test_addon_not_installed(
|
|||||||
|
|
||||||
assert start_addon.call_args == call(hass, "core_matter_server")
|
assert start_addon.call_args == call(hass, "core_matter_server")
|
||||||
assert result["type"] == FlowResultType.CREATE_ENTRY
|
assert result["type"] == FlowResultType.CREATE_ENTRY
|
||||||
assert result["title"] == "ws://host1:5581/ws"
|
assert result["title"] == "Matter"
|
||||||
assert result["data"] == {
|
assert result["data"] == {
|
||||||
"url": "ws://host1:5581/ws",
|
"url": "ws://host1:5581/ws",
|
||||||
"use_addon": True,
|
"use_addon": True,
|
||||||
@ -938,7 +938,7 @@ async def test_addon_not_installed_already_configured(
|
|||||||
data={
|
data={
|
||||||
"url": "ws://localhost:5580/ws",
|
"url": "ws://localhost:5580/ws",
|
||||||
},
|
},
|
||||||
title="ws://localhost:5580/ws",
|
title="Matter",
|
||||||
)
|
)
|
||||||
entry.add_to_hass(hass)
|
entry.add_to_hass(hass)
|
||||||
|
|
||||||
@ -975,5 +975,5 @@ async def test_addon_not_installed_already_configured(
|
|||||||
assert result["type"] == FlowResultType.ABORT
|
assert result["type"] == FlowResultType.ABORT
|
||||||
assert result["reason"] == "reconfiguration_successful"
|
assert result["reason"] == "reconfiguration_successful"
|
||||||
assert entry.data["url"] == "ws://host1:5581/ws"
|
assert entry.data["url"] == "ws://host1:5581/ws"
|
||||||
assert entry.title == "ws://host1:5581/ws"
|
assert entry.title == "Matter"
|
||||||
assert setup_entry.call_count == 1
|
assert setup_entry.call_count == 1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user