Remove YAML configuration from Tuya (#50360)

* Remove YAML configuration from Tuya

* Keep deprecation warning
This commit is contained in:
Franck Nijhof 2021-05-09 20:26:26 +02:00 committed by GitHub
parent ec08256ff0
commit b2cee2e602
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 84 deletions

View file

@ -89,7 +89,6 @@ class TuyaConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
self._password = None
self._platform = None
self._username = None
self._is_import = False
def _save_entry(self):
return self.async_create_entry(
@ -116,11 +115,6 @@ class TuyaConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
return RESULT_SUCCESS
async def async_step_import(self, user_input=None):
"""Handle configuration by yaml file."""
self._is_import = True
return await self.async_step_user(user_input)
async def async_step_user(self, user_input=None):
"""Handle a flow initialized by the user."""
if self._async_current_entries():
@ -139,12 +133,7 @@ class TuyaConfigFlow(config_entries.ConfigFlow, domain=DOMAIN):
if result == RESULT_SUCCESS:
return self._save_entry()
if result != RESULT_AUTH_FAILED or self._is_import:
if self._is_import:
_LOGGER.error(
"Error importing from configuration.yaml: %s",
RESULT_LOG_MESSAGE.get(result, "Generic Error"),
)
if result != RESULT_AUTH_FAILED:
return self.async_abort(reason=result)
errors["base"] = result