Просмотр исходного кода

Sync up naming of steps.

The config flow seems to require form names to match the method naming.
Jason Rumney 4 лет назад
Родитель
Сommit
a088890425

+ 2 - 2
custom_components/tuya_local/config_flow.py

@@ -48,7 +48,7 @@ class ConfigFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
             types.append(type.legacy_type)
         if types:
             return self.async_show_form(
-                step_id="type",
+                step_id="select_type",
                 data_schema=vol.Schema({vol.Required(CONF_TYPE): vol.In(types)}),
             )
         else:
@@ -70,7 +70,7 @@ class ConfigFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
             schema[vol.Optional(e.entity, default=not e.deprecated)] = bool
 
         return self.async_show_form(
-            step_id="entities",
+            step_id="choose_entities",
             data_schema=vol.Schema(schema),
         )
 

+ 2 - 2
custom_components/tuya_local/translations/en.json

@@ -11,14 +11,14 @@
 		    "local_key": "Local key"
 		}
             },
-	    "type": {
+	    "select_type": {
 		"title": "Choose the type of device",
 		"description": "Choose the type that matches your device",
 		"data": {
 		    "type": "Device type"
 		}
 	    },
-	    "entities": {
+	    "choose_entities": {
 		"title": "Device details",
 		"description": "Choose a name for this device, and which entities will be enabled",
 		"data": {