mirror of
https://github.com/home-assistant/core.git
synced 2025-07-23 13:17:32 +00:00
Clean up Husqvarna Automower number platform (#118641)
Address late review and remove unneeded loop in Husqvarna Automower
This commit is contained in:
parent
6a8a975fae
commit
78e5f9578c
@ -131,7 +131,6 @@ async def async_setup_entry(
|
|||||||
async_remove_entities(hass, coordinator, entry, mower_id)
|
async_remove_entities(hass, coordinator, entry, mower_id)
|
||||||
entities.extend(
|
entities.extend(
|
||||||
AutomowerNumberEntity(mower_id, coordinator, description)
|
AutomowerNumberEntity(mower_id, coordinator, description)
|
||||||
for mower_id in coordinator.data
|
|
||||||
for description in NUMBER_TYPES
|
for description in NUMBER_TYPES
|
||||||
if description.exists_fn(coordinator.data[mower_id])
|
if description.exists_fn(coordinator.data[mower_id])
|
||||||
)
|
)
|
||||||
@ -185,7 +184,6 @@ class AutomowerWorkAreaNumberEntity(AutomowerControlEntity, NumberEntity):
|
|||||||
) -> None:
|
) -> None:
|
||||||
"""Set up AutomowerNumberEntity."""
|
"""Set up AutomowerNumberEntity."""
|
||||||
super().__init__(mower_id, coordinator)
|
super().__init__(mower_id, coordinator)
|
||||||
self.coordinator = coordinator
|
|
||||||
self.entity_description = description
|
self.entity_description = description
|
||||||
self.work_area_id = work_area_id
|
self.work_area_id = work_area_id
|
||||||
self._attr_unique_id = f"{mower_id}_{work_area_id}_{description.key}"
|
self._attr_unique_id = f"{mower_id}_{work_area_id}_{description.key}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user