From 78e5f9578c3d007870956ee98c862715e53e7b25 Mon Sep 17 00:00:00 2001 From: Thomas55555 <59625598+Thomas55555@users.noreply.github.com> Date: Mon, 3 Jun 2024 05:13:02 +0200 Subject: [PATCH] Clean up Husqvarna Automower number platform (#118641) Address late review and remove unneeded loop in Husqvarna Automower --- .../components/husqvarna_automower/number.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/homeassistant/components/husqvarna_automower/number.py b/homeassistant/components/husqvarna_automower/number.py index 5e4ba48c230..72c1d360da9 100644 --- a/homeassistant/components/husqvarna_automower/number.py +++ b/homeassistant/components/husqvarna_automower/number.py @@ -129,12 +129,11 @@ async def async_setup_entry( for work_area_id in _work_areas ) async_remove_entities(hass, coordinator, entry, mower_id) - entities.extend( - AutomowerNumberEntity(mower_id, coordinator, description) - for mower_id in coordinator.data - for description in NUMBER_TYPES - if description.exists_fn(coordinator.data[mower_id]) - ) + entities.extend( + AutomowerNumberEntity(mower_id, coordinator, description) + for description in NUMBER_TYPES + if description.exists_fn(coordinator.data[mower_id]) + ) async_add_entities(entities) @@ -185,7 +184,6 @@ class AutomowerWorkAreaNumberEntity(AutomowerControlEntity, NumberEntity): ) -> None: """Set up AutomowerNumberEntity.""" super().__init__(mower_id, coordinator) - self.coordinator = coordinator self.entity_description = description self.work_area_id = work_area_id self._attr_unique_id = f"{mower_id}_{work_area_id}_{description.key}"