From 7d0437808afe39d8aff63824bbe6ab89038c8cc9 Mon Sep 17 00:00:00 2001
From: Jan-Philipp Benecke <jan-philipp@bnck.me>
Date: Thu, 28 Mar 2024 21:28:02 +0100
Subject: [PATCH] Migrate moon to use single_config_entry (#114404)

---
 homeassistant/components/moon/config_flow.py | 3 ---
 homeassistant/components/moon/manifest.json  | 3 ++-
 homeassistant/components/moon/strings.json   | 3 ---
 homeassistant/generated/integrations.json    | 3 ++-
 4 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/homeassistant/components/moon/config_flow.py b/homeassistant/components/moon/config_flow.py
index 1c424c866e4..d8aa082ee3a 100644
--- a/homeassistant/components/moon/config_flow.py
+++ b/homeassistant/components/moon/config_flow.py
@@ -18,9 +18,6 @@ class MoonConfigFlow(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=DEFAULT_NAME, data={})
 
diff --git a/homeassistant/components/moon/manifest.json b/homeassistant/components/moon/manifest.json
index 6102b37fb13..519df85fc9c 100644
--- a/homeassistant/components/moon/manifest.json
+++ b/homeassistant/components/moon/manifest.json
@@ -6,5 +6,6 @@
   "documentation": "https://www.home-assistant.io/integrations/moon",
   "integration_type": "service",
   "iot_class": "calculated",
-  "quality_scale": "internal"
+  "quality_scale": "internal",
+  "single_config_entry": true
 }
diff --git a/homeassistant/components/moon/strings.json b/homeassistant/components/moon/strings.json
index 22b430731e0..e0e2c9ea6f4 100644
--- a/homeassistant/components/moon/strings.json
+++ b/homeassistant/components/moon/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%]"
     }
   },
   "entity": {
diff --git a/homeassistant/generated/integrations.json b/homeassistant/generated/integrations.json
index 53b885ea853..701b2084d7d 100644
--- a/homeassistant/generated/integrations.json
+++ b/homeassistant/generated/integrations.json
@@ -3720,7 +3720,8 @@
     "moon": {
       "integration_type": "service",
       "config_flow": true,
-      "iot_class": "calculated"
+      "iot_class": "calculated",
+      "single_config_entry": true
     },
     "mopeka": {
       "name": "Mopeka",
-- 
GitLab