mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 19:27:45 +00:00
Address late review on adding an error sensor to Husqvarna Automower (#113242)
This commit is contained in:
parent
45195d2ea9
commit
309f554336
@ -21,8 +21,6 @@ MAX_WS_RECONNECT_TIME = 600
|
||||
class AutomowerDataUpdateCoordinator(DataUpdateCoordinator[dict[str, MowerAttributes]]):
|
||||
"""Class to manage fetching Husqvarna data."""
|
||||
|
||||
config_entry: ConfigEntry
|
||||
|
||||
def __init__(
|
||||
self, hass: HomeAssistant, api: AutomowerSession, entry: ConfigEntry
|
||||
) -> None:
|
||||
|
@ -3,7 +3,6 @@
|
||||
import logging
|
||||
|
||||
from aioautomower.model import MowerAttributes
|
||||
from aioautomower.utils import structure_token
|
||||
|
||||
from homeassistant.helpers.device_registry import DeviceInfo
|
||||
from homeassistant.helpers.update_coordinator import CoordinatorEntity
|
||||
@ -13,8 +12,6 @@ from .const import DOMAIN
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
HUSQVARNA_URL = "https://developer.husqvarnagroup.cloud"
|
||||
|
||||
|
||||
class AutomowerBaseEntity(CoordinatorEntity[AutomowerDataUpdateCoordinator]):
|
||||
"""Defining the Automower base Entity."""
|
||||
@ -29,10 +26,7 @@ class AutomowerBaseEntity(CoordinatorEntity[AutomowerDataUpdateCoordinator]):
|
||||
"""Initialize AutomowerEntity."""
|
||||
super().__init__(coordinator)
|
||||
self.mower_id = mower_id
|
||||
entry = coordinator.config_entry
|
||||
structured_token = structure_token(entry.data["token"]["access_token"])
|
||||
self._attr_device_info = DeviceInfo(
|
||||
configuration_url=f"{HUSQVARNA_URL}/applications/{structured_token.client_id}",
|
||||
identifiers={(DOMAIN, mower_id)},
|
||||
manufacturer="Husqvarna",
|
||||
model=self.mower_attributes.system.model,
|
||||
|
@ -3,7 +3,7 @@
|
||||
DeviceRegistryEntrySnapshot({
|
||||
'area_id': 'garden',
|
||||
'config_entries': <ANY>,
|
||||
'configuration_url': 'https://developer.husqvarnagroup.cloud/applications/433e5fdf-5129-452c-xxxx-fadce3213042',
|
||||
'configuration_url': None,
|
||||
'connections': set({
|
||||
}),
|
||||
'disabled_by': None,
|
||||
|
Loading…
x
Reference in New Issue
Block a user