Implement capability attributes (#30545)
* Implement capability attributes * Fix HeOS update order * Fix test
This commit is contained in:
1 parent
4cd83e71dd
commit
ed6aef2fd7
6 files changed
+58
-14
No files matched your search
@@ -115,7 +115,6 @@ class HeosMediaPlayer(MediaPlayerDevice):
|
||||
|
||||
async def async_added_to_hass(self):
|
||||
"""Device added to hass."""
|
||||
self._source_manager = self.hass.data[HEOS_DOMAIN][DATA_SOURCE_MANAGER]
|
||||
# Update state when attributes of the player change
|
||||
self._signals.append(
|
||||
self._player.heos.dispatcher.connect(
|
||||
@@ -242,6 +241,9 @@ class HeosMediaPlayer(MediaPlayerDevice):
|
||||
current_support = [CONTROL_TO_SUPPORT[control] for control in controls]
|
||||
self._supported_features = reduce(ior, current_support, BASE_SUPPORTED_FEATURES)
|
||||
|
||||
if self._source_manager is None:
|
||||
self._source_manager = self.hass.data[HEOS_DOMAIN][DATA_SOURCE_MANAGER]
|
||||
|
||||
async def async_will_remove_from_hass(self):
|
||||
"""Disconnect the device when removed."""
|
||||
for signal_remove in self._signals:
|
||||
|
||||
Reference in new issue
Block a user