Skip to content

Commit

Permalink
Move static attributes outside of ws66i constructor (#99922)
Browse files Browse the repository at this point in the history
Move static attributes outside of ws66i cosntructor
  • Loading branch information
joostlek authored Sep 9, 2023
1 parent 4bc079b commit 6c613fd
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions homeassistant/components/ws66i/media_player.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,14 @@ class Ws66iZone(CoordinatorEntity[Ws66iDataUpdateCoordinator], MediaPlayerEntity

_attr_has_entity_name = True
_attr_name = None
_attr_supported_features = (
MediaPlayerEntityFeature.VOLUME_MUTE
| MediaPlayerEntityFeature.VOLUME_SET
| MediaPlayerEntityFeature.VOLUME_STEP
| MediaPlayerEntityFeature.TURN_ON
| MediaPlayerEntityFeature.TURN_OFF
| MediaPlayerEntityFeature.SELECT_SOURCE
)

def __init__(
self,
Expand All @@ -64,18 +72,10 @@ def __init__(
self._zone_id_idx: int = data_idx
self._status: ZoneStatus = coordinator.data[data_idx]
self._attr_source_list = ws66i_data.sources.name_list
self._attr_unique_id = f"{entry_id}_{self._zone_id}"
self._attr_supported_features = (
MediaPlayerEntityFeature.VOLUME_MUTE
| MediaPlayerEntityFeature.VOLUME_SET
| MediaPlayerEntityFeature.VOLUME_STEP
| MediaPlayerEntityFeature.TURN_ON
| MediaPlayerEntityFeature.TURN_OFF
| MediaPlayerEntityFeature.SELECT_SOURCE
)
self._attr_unique_id = f"{entry_id}_{zone_id}"
self._attr_device_info = DeviceInfo(
identifiers={(DOMAIN, str(self.unique_id))},
name=f"Zone {self._zone_id}",
name=f"Zone {zone_id}",
manufacturer="Soundavo",
model="WS66i 6-Zone Amplifier",
)
Expand Down

0 comments on commit 6c613fd

Please sign in to comment.