Improve lists in integrations [A] (#113006)
* Use list comprehension [A] * Use list comprehension [A] * Update homeassistant/components/aws/notify.py
This commit is contained in:
parent
bf40b33117
commit
690ba103ed
29 changed files with 267 additions and 297 deletions
|
@ -368,20 +368,16 @@ async def async_setup_entry(
|
|||
name: str = domain_data[ENTRY_NAME]
|
||||
coordinator: WeatherUpdateCoordinator = domain_data[ENTRY_WEATHER_COORDINATOR]
|
||||
|
||||
entities: list[AemetSensor] = []
|
||||
|
||||
for description in FORECAST_SENSORS + WEATHER_SENSORS:
|
||||
if dict_nested_value(coordinator.data["lib"], description.keys) is not None:
|
||||
entities.append(
|
||||
AemetSensor(
|
||||
name,
|
||||
coordinator,
|
||||
description,
|
||||
config_entry,
|
||||
)
|
||||
)
|
||||
|
||||
async_add_entities(entities)
|
||||
async_add_entities(
|
||||
AemetSensor(
|
||||
name,
|
||||
coordinator,
|
||||
description,
|
||||
config_entry,
|
||||
)
|
||||
for description in FORECAST_SENSORS + WEATHER_SENSORS
|
||||
if dict_nested_value(coordinator.data["lib"], description.keys) is not None
|
||||
)
|
||||
|
||||
|
||||
class AemetSensor(AemetEntity, SensorEntity):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue