From 309f5543369a904d91a6505b57486ca58b53e910 Mon Sep 17 00:00:00 2001 From: Thomas55555 <59625598+Thomas55555@users.noreply.github.com> Date: Fri, 15 Mar 2024 12:04:33 +0100 Subject: [PATCH] Address late review on adding an error sensor to Husqvarna Automower (#113242) --- homeassistant/components/husqvarna_automower/coordinator.py | 2 -- homeassistant/components/husqvarna_automower/entity.py | 6 ------ .../components/husqvarna_automower/snapshots/test_init.ambr | 2 +- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/homeassistant/components/husqvarna_automower/coordinator.py b/homeassistant/components/husqvarna_automower/coordinator.py index eb2c06262cf..2188725ed76 100644 --- a/homeassistant/components/husqvarna_automower/coordinator.py +++ b/homeassistant/components/husqvarna_automower/coordinator.py @@ -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: diff --git a/homeassistant/components/husqvarna_automower/entity.py b/homeassistant/components/husqvarna_automower/entity.py index c33229a5f64..4d20d2d677b 100644 --- a/homeassistant/components/husqvarna_automower/entity.py +++ b/homeassistant/components/husqvarna_automower/entity.py @@ -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, diff --git a/tests/components/husqvarna_automower/snapshots/test_init.ambr b/tests/components/husqvarna_automower/snapshots/test_init.ambr index 63ca15461e1..c3a7191b4b9 100644 --- a/tests/components/husqvarna_automower/snapshots/test_init.ambr +++ b/tests/components/husqvarna_automower/snapshots/test_init.ambr @@ -3,7 +3,7 @@ DeviceRegistryEntrySnapshot({ 'area_id': 'garden', 'config_entries': , - 'configuration_url': 'https://developer.husqvarnagroup.cloud/applications/433e5fdf-5129-452c-xxxx-fadce3213042', + 'configuration_url': None, 'connections': set({ }), 'disabled_by': None,