From dcd00546ba1ff49534fdd3db4f0d653f9e786c12 Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Thu, 7 Sep 2023 19:47:56 +0200 Subject: [PATCH] Use shorthand attributes in Sonarr (#99844) --- homeassistant/components/sonarr/entity.py | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/sonarr/entity.py b/homeassistant/components/sonarr/entity.py index d73b9d852c8..6231ca3903a 100644 --- a/homeassistant/components/sonarr/entity.py +++ b/homeassistant/components/sonarr/entity.py @@ -24,15 +24,11 @@ class SonarrEntity(CoordinatorEntity[SonarrDataUpdateCoordinator[SonarrDataT]]): self.coordinator = coordinator self.entity_description = description self._attr_unique_id = f"{coordinator.config_entry.entry_id}_{description.key}" - - @property - def device_info(self) -> DeviceInfo: - """Return device information about the application.""" - return DeviceInfo( - configuration_url=self.coordinator.host_configuration.base_url, + self._attr_device_info = DeviceInfo( + configuration_url=coordinator.host_configuration.base_url, entry_type=DeviceEntryType.SERVICE, - identifiers={(DOMAIN, self.coordinator.config_entry.entry_id)}, + identifiers={(DOMAIN, coordinator.config_entry.entry_id)}, manufacturer=DEFAULT_NAME, name=DEFAULT_NAME, - sw_version=self.coordinator.system_version, + sw_version=coordinator.system_version, )