mirror of
https://github.com/home-assistant/core.git
synced 2025-07-28 07:37:34 +00:00
Clean up common modules in Husqvarna Automower (#132290)
This commit is contained in:
parent
80ad154dcd
commit
de0ffea52d
@ -67,7 +67,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: AutomowerConfigEntry) ->
|
|||||||
# without the scope. So only polling would be possible.
|
# without the scope. So only polling would be possible.
|
||||||
raise ConfigEntryAuthFailed
|
raise ConfigEntryAuthFailed
|
||||||
|
|
||||||
coordinator = AutomowerDataUpdateCoordinator(hass, automower_api, entry)
|
coordinator = AutomowerDataUpdateCoordinator(hass, automower_api)
|
||||||
await coordinator.async_config_entry_first_refresh()
|
await coordinator.async_config_entry_first_refresh()
|
||||||
available_devices = list(coordinator.data)
|
available_devices = list(coordinator.data)
|
||||||
cleanup_removed_devices(hass, coordinator.config_entry, available_devices)
|
cleanup_removed_devices(hass, coordinator.config_entry, available_devices)
|
||||||
|
@ -31,9 +31,7 @@ class AutomowerDataUpdateCoordinator(DataUpdateCoordinator[dict[str, MowerAttrib
|
|||||||
|
|
||||||
config_entry: ConfigEntry
|
config_entry: ConfigEntry
|
||||||
|
|
||||||
def __init__(
|
def __init__(self, hass: HomeAssistant, api: AutomowerSession) -> None:
|
||||||
self, hass: HomeAssistant, api: AutomowerSession, entry: ConfigEntry
|
|
||||||
) -> None:
|
|
||||||
"""Initialize data updater."""
|
"""Initialize data updater."""
|
||||||
super().__init__(
|
super().__init__(
|
||||||
hass,
|
hass,
|
||||||
|
@ -133,7 +133,7 @@ class AutomowerControlEntity(AutomowerAvailableEntity):
|
|||||||
|
|
||||||
|
|
||||||
class WorkAreaAvailableEntity(AutomowerAvailableEntity):
|
class WorkAreaAvailableEntity(AutomowerAvailableEntity):
|
||||||
"""Base entity for work work areas."""
|
"""Base entity for work areas."""
|
||||||
|
|
||||||
def __init__(
|
def __init__(
|
||||||
self,
|
self,
|
||||||
@ -164,4 +164,4 @@ class WorkAreaAvailableEntity(AutomowerAvailableEntity):
|
|||||||
|
|
||||||
|
|
||||||
class WorkAreaControlEntity(WorkAreaAvailableEntity, AutomowerControlEntity):
|
class WorkAreaControlEntity(WorkAreaAvailableEntity, AutomowerControlEntity):
|
||||||
"""Base entity work work areas with control function."""
|
"""Base entity for work areas with control function."""
|
||||||
|
@ -18,11 +18,7 @@ rules:
|
|||||||
status: done
|
status: done
|
||||||
comment: |
|
comment: |
|
||||||
The integration only has an entity service, registered in the platform.
|
The integration only has an entity service, registered in the platform.
|
||||||
common-modules:
|
common-modules: done
|
||||||
status: todo
|
|
||||||
comment: |
|
|
||||||
Remove unused config_entry in coordinator.
|
|
||||||
Fix typos in entity.py
|
|
||||||
docs-high-level-description: done
|
docs-high-level-description: done
|
||||||
docs-installation-instructions: done
|
docs-installation-instructions: done
|
||||||
docs-removal-instructions: done
|
docs-removal-instructions: done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user