From e79a1a52c3382ebacb78deb4f5ceb5122071c66c Mon Sep 17 00:00:00 2001 From: Erik Montnemery Date: Thu, 20 Feb 2025 09:08:46 +0100 Subject: [PATCH] Adjust config entry state checks in esphome (#138914) --- homeassistant/components/esphome/dashboard.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/homeassistant/components/esphome/dashboard.py b/homeassistant/components/esphome/dashboard.py index 334c16e5730..290feec1e2a 100644 --- a/homeassistant/components/esphome/dashboard.py +++ b/homeassistant/components/esphome/dashboard.py @@ -6,7 +6,7 @@ import asyncio import logging from typing import Any -from homeassistant.config_entries import SOURCE_REAUTH, ConfigEntryState +from homeassistant.config_entries import SOURCE_REAUTH from homeassistant.const import EVENT_HOMEASSISTANT_STOP from homeassistant.core import CALLBACK_TYPE, Event, HomeAssistant, callback from homeassistant.helpers.aiohttp_client import async_get_clientsession @@ -108,8 +108,7 @@ class ESPHomeDashboardManager: reloads = [ hass.config_entries.async_reload(entry.entry_id) - for entry in hass.config_entries.async_entries(DOMAIN) - if entry.state is ConfigEntryState.LOADED + for entry in hass.config_entries.async_loaded_entries(DOMAIN) ] # Re-auth flows will check the dashboard for encryption key when the form is requested # but we only trigger reauth if the dashboard is available.