From 968f5f1a34dee035392ba132a46594b9ae3615b9 Mon Sep 17 00:00:00 2001 From: Jan-Philipp Benecke Date: Tue, 5 Mar 2024 21:10:30 +0100 Subject: [PATCH] Remove list comprehension when adding entities in Wallbox (#112433) --- homeassistant/components/wallbox/lock.py | 8 +++----- homeassistant/components/wallbox/number.py | 8 +++----- homeassistant/components/wallbox/sensor.py | 8 +++----- 3 files changed, 9 insertions(+), 15 deletions(-) diff --git a/homeassistant/components/wallbox/lock.py b/homeassistant/components/wallbox/lock.py index 11a66a4814c..195d76e9238 100644 --- a/homeassistant/components/wallbox/lock.py +++ b/homeassistant/components/wallbox/lock.py @@ -42,11 +42,9 @@ async def async_setup_entry( raise PlatformNotReady from exc async_add_entities( - [ - WallboxLock(coordinator, description) - for ent in coordinator.data - if (description := LOCK_TYPES.get(ent)) - ] + WallboxLock(coordinator, description) + for ent in coordinator.data + if (description := LOCK_TYPES.get(ent)) ) diff --git a/homeassistant/components/wallbox/number.py b/homeassistant/components/wallbox/number.py index 76cf8316959..695a7960e51 100644 --- a/homeassistant/components/wallbox/number.py +++ b/homeassistant/components/wallbox/number.py @@ -92,11 +92,9 @@ async def async_setup_entry( raise PlatformNotReady from exc async_add_entities( - [ - WallboxNumber(coordinator, entry, description) - for ent in coordinator.data - if (description := NUMBER_TYPES.get(ent)) - ] + WallboxNumber(coordinator, entry, description) + for ent in coordinator.data + if (description := NUMBER_TYPES.get(ent)) ) diff --git a/homeassistant/components/wallbox/sensor.py b/homeassistant/components/wallbox/sensor.py index 5a825722d53..50312487e15 100644 --- a/homeassistant/components/wallbox/sensor.py +++ b/homeassistant/components/wallbox/sensor.py @@ -161,11 +161,9 @@ async def async_setup_entry( coordinator: WallboxCoordinator = hass.data[DOMAIN][entry.entry_id] async_add_entities( - [ - WallboxSensor(coordinator, description) - for ent in coordinator.data - if (description := SENSOR_TYPES.get(ent)) - ] + WallboxSensor(coordinator, description) + for ent in coordinator.data + if (description := SENSOR_TYPES.get(ent)) )