mirror of
https://github.com/home-assistant/core.git
synced 2025-07-10 14:57:09 +00:00
Clean up variables in Soundtouch (#99859)
This commit is contained in:
parent
5e2bf2b015
commit
76c569c62d
@ -78,21 +78,25 @@ class SoundTouchMediaPlayer(MediaPlayerEntity):
|
|||||||
_attr_device_class = MediaPlayerDeviceClass.SPEAKER
|
_attr_device_class = MediaPlayerDeviceClass.SPEAKER
|
||||||
_attr_has_entity_name = True
|
_attr_has_entity_name = True
|
||||||
_attr_name = None
|
_attr_name = None
|
||||||
|
_attr_source_list = [
|
||||||
|
Source.AUX.value,
|
||||||
|
Source.BLUETOOTH.value,
|
||||||
|
]
|
||||||
|
|
||||||
def __init__(self, device: SoundTouchDevice) -> None:
|
def __init__(self, device: SoundTouchDevice) -> None:
|
||||||
"""Create SoundTouch media player entity."""
|
"""Create SoundTouch media player entity."""
|
||||||
|
|
||||||
self._device = device
|
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(
|
self._attr_device_info = DeviceInfo(
|
||||||
identifiers={(DOMAIN, self._device.config.device_id)},
|
identifiers={(DOMAIN, device.config.device_id)},
|
||||||
connections={
|
connections={
|
||||||
(CONNECTION_NETWORK_MAC, format_mac(self._device.config.mac_address))
|
(CONNECTION_NETWORK_MAC, format_mac(device.config.mac_address))
|
||||||
},
|
},
|
||||||
manufacturer="Bose Corporation",
|
manufacturer="Bose Corporation",
|
||||||
model=self._device.config.type,
|
model=device.config.type,
|
||||||
name=self._device.config.name,
|
name=device.config.name,
|
||||||
)
|
)
|
||||||
|
|
||||||
self._status = None
|
self._status = None
|
||||||
@ -131,14 +135,6 @@ class SoundTouchMediaPlayer(MediaPlayerEntity):
|
|||||||
"""Name of the current input source."""
|
"""Name of the current input source."""
|
||||||
return self._status.source
|
return self._status.source
|
||||||
|
|
||||||
@property
|
|
||||||
def source_list(self):
|
|
||||||
"""List of available input sources."""
|
|
||||||
return [
|
|
||||||
Source.AUX.value,
|
|
||||||
Source.BLUETOOTH.value,
|
|
||||||
]
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def is_volume_muted(self):
|
def is_volume_muted(self):
|
||||||
"""Boolean if volume is currently muted."""
|
"""Boolean if volume is currently muted."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user