Răsfoiți Sursa

Skip device naming step in config flow; use defaults

ZiB 4 luni în urmă
părinte
comite
d16acf6e01

+ 1 - 19
custom_components/room_cal_ha/config_flow.py

@@ -19,13 +19,8 @@ from .const import (
   CONF_CALDAV_ENABLED,
   CONF_CALDAV_URL,
   CONF_CALENDAR_NAME,
-  CONF_CURRENT_NAME,
-  CONF_NEXT_NAME,
   CONF_PASSWORD,
-  CONF_ROOM_STATE_NAME,
   CONF_USERNAME,
-  DEFAULT_CURRENT_NAME,
-  DEFAULT_NEXT_NAME,
   DEFAULT_ROOM_STATE_NAME,
   DOMAIN,
 )
@@ -37,20 +32,7 @@ class RoomCalConfigFlow(ConfigFlow, domain=DOMAIN):
   async def async_step_user(
     self, user_input: dict[str, Any] | None = None
   ) -> ConfigFlowResult:
-    if user_input is not None:
-      return self.async_create_entry(
-        title=user_input[CONF_ROOM_STATE_NAME],
-        data=user_input,
-      )
-
-    return self.async_show_form(
-      step_id="user",
-      data_schema=vol.Schema({
-        vol.Required(CONF_ROOM_STATE_NAME, default=DEFAULT_ROOM_STATE_NAME): str,
-        vol.Required(CONF_CURRENT_NAME, default=DEFAULT_CURRENT_NAME): str,
-        vol.Required(CONF_NEXT_NAME, default=DEFAULT_NEXT_NAME): str,
-      }),
-    )
+    return self.async_create_entry(title=DEFAULT_ROOM_STATE_NAME, data={})
 
   async def async_step_reauth(
     self, entry_data: dict[str, Any]

+ 0 - 9
custom_components/room_cal_ha/strings.json

@@ -1,15 +1,6 @@
 {
   "config": {
     "step": {
-      "user": {
-        "title": "Set up Room Calendar",
-        "description": "Name the three devices this integration will create.",
-        "data": {
-          "room_state_name": "Room State device name",
-          "current_name": "Current reservation device name",
-          "next_name": "Next reservation device name"
-        }
-      },
       "reauth_confirm": {
         "title": "Re-authenticate CalDAV",
         "description": "Enter your CalDAV credentials to restore the connection.",

+ 0 - 9
custom_components/room_cal_ha/translations/en.json

@@ -1,15 +1,6 @@
 {
   "config": {
     "step": {
-      "user": {
-        "title": "Set up Room Calendar",
-        "description": "Name the three devices this integration will create.",
-        "data": {
-          "room_state_name": "Room State device name",
-          "current_name": "Current reservation device name",
-          "next_name": "Next reservation device name"
-        }
-      },
       "reauth_confirm": {
         "title": "Re-authenticate CalDAV",
         "description": "Enter your CalDAV credentials to restore the connection.",