From 4e202eb3767622bdfd2995955c25cf6c3edfc72b Mon Sep 17 00:00:00 2001 From: Joost Lekkerkerker Date: Tue, 12 Sep 2023 17:35:01 +0200 Subject: [PATCH] Use shorthand attributes in Yamaha Musiccast (#100220) --- .../components/yamaha_musiccast/__init__.py | 21 +++---------------- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/homeassistant/components/yamaha_musiccast/__init__.py b/homeassistant/components/yamaha_musiccast/__init__.py index c3851074365..9e8b8fed530 100644 --- a/homeassistant/components/yamaha_musiccast/__init__.py +++ b/homeassistant/components/yamaha_musiccast/__init__.py @@ -136,24 +136,9 @@ class MusicCastEntity(CoordinatorEntity[MusicCastDataUpdateCoordinator]): ) -> None: """Initialize the MusicCast entity.""" super().__init__(coordinator) - self._enabled_default = enabled_default - self._icon = icon - self._name = name - - @property - def name(self) -> str: - """Return the name of the entity.""" - return self._name - - @property - def icon(self) -> str: - """Return the mdi icon of the entity.""" - return self._icon - - @property - def entity_registry_enabled_default(self) -> bool: - """Return if the entity should be enabled when first added to the entity registry.""" - return self._enabled_default + self._attr_entity_registry_enabled_default = enabled_default + self._attr_icon = icon + self._attr_name = name class MusicCastDeviceEntity(MusicCastEntity):