From 4b9296f4f14d2fcf6f32da0db4ea92061547e46f Mon Sep 17 00:00:00 2001 From: Jan Bouwhuis Date: Tue, 10 Oct 2023 19:58:43 +0200 Subject: [PATCH] Code quality issue met integration (#101768) * Fix unreachable code for met integration * Make code better readable --- homeassistant/components/met/weather.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/met/weather.py b/homeassistant/components/met/weather.py index a1cc1ade8e1..def06634f42 100644 --- a/homeassistant/components/met/weather.py +++ b/homeassistant/components/met/weather.py @@ -55,10 +55,10 @@ async def async_setup_entry( is_metric = hass.config.units is METRIC_SYSTEM if config_entry.data.get(CONF_TRACK_HOME, False): name = hass.config.location_name - elif (name := config_entry.data.get(CONF_NAME)) and name is None: - name = DEFAULT_NAME - elif TYPE_CHECKING: - assert isinstance(name, str) + else: + name = config_entry.data.get(CONF_NAME, DEFAULT_NAME) + if TYPE_CHECKING: + assert isinstance(name, str) entities = [MetWeather(coordinator, config_entry.data, False, name, is_metric)]