diff --git a/homeassistant/components/ntfy/config_flow.py b/homeassistant/components/ntfy/config_flow.py index ed8d56820c2..ba409070c76 100644 --- a/homeassistant/components/ntfy/config_flow.py +++ b/homeassistant/components/ntfy/config_flow.py @@ -408,7 +408,7 @@ class TopicSubentryFlowHandler(ConfigSubentryFlow): return self.async_create_entry( title=user_input.get(CONF_NAME, user_input[CONF_TOPIC]), - data=user_input, + data={CONF_TOPIC: user_input[CONF_TOPIC]}, unique_id=user_input[CONF_TOPIC], ) return self.async_show_form( diff --git a/homeassistant/components/ntfy/notify.py b/homeassistant/components/ntfy/notify.py index e10e64caf23..214e3d7e125 100644 --- a/homeassistant/components/ntfy/notify.py +++ b/homeassistant/components/ntfy/notify.py @@ -16,7 +16,7 @@ from homeassistant.components.notify import ( NotifyEntityFeature, ) from homeassistant.config_entries import ConfigSubentry -from homeassistant.const import CONF_NAME, CONF_URL +from homeassistant.const import CONF_URL from homeassistant.core import HomeAssistant from homeassistant.exceptions import HomeAssistantError from homeassistant.helpers.device_registry import DeviceEntryType, DeviceInfo @@ -66,7 +66,7 @@ class NtfyNotifyEntity(NotifyEntity): entry_type=DeviceEntryType.SERVICE, manufacturer="ntfy LLC", model="ntfy", - name=subentry.data.get(CONF_NAME, self.topic), + name=subentry.title, configuration_url=URL(config_entry.data[CONF_URL]) / self.topic, identifiers={(DOMAIN, f"{config_entry.entry_id}_{subentry.subentry_id}")}, via_device=(DOMAIN, config_entry.entry_id), diff --git a/tests/components/ntfy/test_config_flow.py b/tests/components/ntfy/test_config_flow.py index 48909552e08..0bc48833702 100644 --- a/tests/components/ntfy/test_config_flow.py +++ b/tests/components/ntfy/test_config_flow.py @@ -266,7 +266,7 @@ async def test_generated_topic(hass: HomeAssistant, mock_random: AsyncMock) -> N subentry_id = list(config_entry.subentries)[0] assert config_entry.subentries == { subentry_id: ConfigSubentry( - data={CONF_TOPIC: "randomtopic", CONF_NAME: "mytopic"}, + data={CONF_TOPIC: "randomtopic"}, subentry_id=subentry_id, subentry_type="topic", title="mytopic",