From e14573a465429147f5bcd3a56416de5c07cb5110 Mon Sep 17 00:00:00 2001 From: Jan-Philipp Benecke Date: Mon, 1 Apr 2024 23:33:29 +0200 Subject: [PATCH] Migrate uptime to use single_config_entry (#114586) --- homeassistant/components/uptime/config_flow.py | 3 --- homeassistant/components/uptime/manifest.json | 3 ++- homeassistant/components/uptime/strings.json | 3 --- homeassistant/generated/integrations.json | 3 ++- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/uptime/config_flow.py b/homeassistant/components/uptime/config_flow.py index 2cfec38d200..6dd68bae148 100644 --- a/homeassistant/components/uptime/config_flow.py +++ b/homeassistant/components/uptime/config_flow.py @@ -20,9 +20,6 @@ class UptimeConfigFlow(ConfigFlow, domain=DOMAIN): self, user_input: dict[str, Any] | None = None ) -> ConfigFlowResult: """Handle a flow initialized by the user.""" - if self._async_current_entries(): - return self.async_abort(reason="single_instance_allowed") - if user_input is not None: return self.async_create_entry( title="Uptime", diff --git a/homeassistant/components/uptime/manifest.json b/homeassistant/components/uptime/manifest.json index 2b4dbcd0fec..37e61976b9c 100644 --- a/homeassistant/components/uptime/manifest.json +++ b/homeassistant/components/uptime/manifest.json @@ -6,5 +6,6 @@ "documentation": "https://www.home-assistant.io/integrations/uptime", "integration_type": "service", "iot_class": "local_push", - "quality_scale": "internal" + "quality_scale": "internal", + "single_config_entry": true } diff --git a/homeassistant/components/uptime/strings.json b/homeassistant/components/uptime/strings.json index 9ceb91de9ba..868c2a51588 100644 --- a/homeassistant/components/uptime/strings.json +++ b/homeassistant/components/uptime/strings.json @@ -5,9 +5,6 @@ "user": { "description": "[%key:common::config_flow::description::confirm_setup%]" } - }, - "abort": { - "single_instance_allowed": "[%key:common::config_flow::abort::single_instance_allowed%]" } } } diff --git a/homeassistant/generated/integrations.json b/homeassistant/generated/integrations.json index b4eff321e6e..feb5a373505 100644 --- a/homeassistant/generated/integrations.json +++ b/homeassistant/generated/integrations.json @@ -6472,7 +6472,8 @@ "uptime": { "integration_type": "service", "config_flow": true, - "iot_class": "local_push" + "iot_class": "local_push", + "single_config_entry": true }, "uptimerobot": { "name": "UptimeRobot",