mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Code quality issue met integration (#101768)
* Fix unreachable code for met integration * Make code better readable
This commit is contained in:
parent
7b4b8e7516
commit
4b9296f4f1
@ -55,10 +55,10 @@ async def async_setup_entry(
|
|||||||
is_metric = hass.config.units is METRIC_SYSTEM
|
is_metric = hass.config.units is METRIC_SYSTEM
|
||||||
if config_entry.data.get(CONF_TRACK_HOME, False):
|
if config_entry.data.get(CONF_TRACK_HOME, False):
|
||||||
name = hass.config.location_name
|
name = hass.config.location_name
|
||||||
elif (name := config_entry.data.get(CONF_NAME)) and name is None:
|
else:
|
||||||
name = DEFAULT_NAME
|
name = config_entry.data.get(CONF_NAME, DEFAULT_NAME)
|
||||||
elif TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
assert isinstance(name, str)
|
assert isinstance(name, str)
|
||||||
|
|
||||||
entities = [MetWeather(coordinator, config_entry.data, False, name, is_metric)]
|
entities = [MetWeather(coordinator, config_entry.data, False, name, is_metric)]
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user