Don't attempt setup on migrated AirVisual Pro in the airvisual domain (#84796)

fixes undefined
This commit is contained in:
Aaron Bach 2022-12-29 15:57:50 -07:00 committed by GitHub
parent e33cea9ff7
commit c0da80b567
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -206,6 +206,11 @@ def _standardize_geography_config_entry(
async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Set up AirVisual as config entry."""
if CONF_API_KEY not in entry.data:
# If this is a migrated AirVisual Pro entry, there's no actual setup to do;
# that will be handled by the `airvisual_pro` domain:
return False
_standardize_geography_config_entry(hass, entry)
websession = aiohttp_client.async_get_clientsession(hass)