From 8d7318430cd724d1d89259cf33107ed9b05a16ff Mon Sep 17 00:00:00 2001 From: Simone Chemelli Date: Wed, 12 May 2021 01:47:02 +0200 Subject: [PATCH] Fix mypy for Fritz after #50056, #50327 conflict (#50497) --- homeassistant/components/fritz/services.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/homeassistant/components/fritz/services.py b/homeassistant/components/fritz/services.py index 197a138c36e..1e3a792f9bc 100644 --- a/homeassistant/components/fritz/services.py +++ b/homeassistant/components/fritz/services.py @@ -43,11 +43,12 @@ async def _async_get_configured_fritz_tools( ): """Get FritzBoxTools class from config entry.""" - return [ - entry_id - for entry_id in await async_extract_config_entry_ids(hass, service_call) - if hass.config_entries.async_get_entry(entry_id).domain == DOMAIN - ] + list_entry_id = [] + for entry_id in await async_extract_config_entry_ids(hass, service_call): + config_entry = hass.config_entries.async_get_entry(entry_id) + if config_entry and config_entry.domain == DOMAIN: + list_entry_id.append(entry_id) + return list_entry_id async def async_unload_services(hass: HomeAssistant):