Clean up variables in Soundtouch (#99859)

This commit is contained in:
Joost Lekkerkerker 2023-09-12 21:00:05 +02:00 committed by GitHub
parent 5e2bf2b015
commit 76c569c62d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -78,21 +78,25 @@ class SoundTouchMediaPlayer(MediaPlayerEntity):
_attr_device_class = MediaPlayerDeviceClass.SPEAKER
_attr_has_entity_name = True
_attr_name = None
_attr_source_list = [
Source.AUX.value,
Source.BLUETOOTH.value,
]
def __init__(self, device: SoundTouchDevice) -> None:
"""Create SoundTouch media player entity."""
self._device = device
self._attr_unique_id = self._device.config.device_id
self._attr_unique_id = device.config.device_id
self._attr_device_info = DeviceInfo(
identifiers={(DOMAIN, self._device.config.device_id)},
identifiers={(DOMAIN, device.config.device_id)},
connections={
(CONNECTION_NETWORK_MAC, format_mac(self._device.config.mac_address))
(CONNECTION_NETWORK_MAC, format_mac(device.config.mac_address))
},
manufacturer="Bose Corporation",
model=self._device.config.type,
name=self._device.config.name,
model=device.config.type,
name=device.config.name,
)
self._status = None
@ -131,14 +135,6 @@ class SoundTouchMediaPlayer(MediaPlayerEntity):
"""Name of the current input source."""
return self._status.source
@property
def source_list(self):
"""List of available input sources."""
return [
Source.AUX.value,
Source.BLUETOOTH.value,
]
@property
def is_volume_muted(self):
"""Boolean if volume is currently muted."""