Clean up old config entry migration from Tuya (#103026)
This commit is contained in:
parent
46ecf0d4bd
commit
b323295aa1
1 changed files with 0 additions and 8 deletions
|
@ -28,7 +28,6 @@ from .const import (
|
|||
CONF_COUNTRY_CODE,
|
||||
CONF_ENDPOINT,
|
||||
CONF_PASSWORD,
|
||||
CONF_PROJECT_TYPE,
|
||||
CONF_USERNAME,
|
||||
DOMAIN,
|
||||
LOGGER,
|
||||
|
@ -50,13 +49,6 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||
"""Async setup hass config entry."""
|
||||
hass.data.setdefault(DOMAIN, {})
|
||||
|
||||
# Project type has been renamed to auth type in the upstream Tuya IoT SDK.
|
||||
# This migrates existing config entries to reflect that name change.
|
||||
if CONF_PROJECT_TYPE in entry.data:
|
||||
data = {**entry.data, CONF_AUTH_TYPE: entry.data[CONF_PROJECT_TYPE]}
|
||||
data.pop(CONF_PROJECT_TYPE)
|
||||
hass.config_entries.async_update_entry(entry, data=data)
|
||||
|
||||
auth_type = AuthType(entry.data[CONF_AUTH_TYPE])
|
||||
api = TuyaOpenAPI(
|
||||
endpoint=entry.data[CONF_ENDPOINT],
|
||||
|
|
Loading…
Add table
Reference in a new issue