Move static attributes outside of ws66i constructor (#99922)

Move static attributes outside of ws66i cosntructor
pull/100017/head
Joost Lekkerkerker 2023-09-10 00:38:43 +02:00 committed by GitHub
parent 4bc079b219
commit 6c613fd255
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 10 deletions

View File

@ -46,6 +46,14 @@ class Ws66iZone(CoordinatorEntity[Ws66iDataUpdateCoordinator], MediaPlayerEntity
_attr_has_entity_name = True _attr_has_entity_name = True
_attr_name = None _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__( def __init__(
self, self,
@ -64,18 +72,10 @@ class Ws66iZone(CoordinatorEntity[Ws66iDataUpdateCoordinator], MediaPlayerEntity
self._zone_id_idx: int = data_idx self._zone_id_idx: int = data_idx
self._status: ZoneStatus = coordinator.data[data_idx] self._status: ZoneStatus = coordinator.data[data_idx]
self._attr_source_list = ws66i_data.sources.name_list self._attr_source_list = ws66i_data.sources.name_list
self._attr_unique_id = f"{entry_id}_{self._zone_id}" self._attr_unique_id = f"{entry_id}_{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_device_info = DeviceInfo( self._attr_device_info = DeviceInfo(
identifiers={(DOMAIN, str(self.unique_id))}, identifiers={(DOMAIN, str(self.unique_id))},
name=f"Zone {self._zone_id}", name=f"Zone {zone_id}",
manufacturer="Soundavo", manufacturer="Soundavo",
model="WS66i 6-Zone Amplifier", model="WS66i 6-Zone Amplifier",
) )