Set Google Cast audio devices as speakers (#73832)
This commit is contained in:
parent
ef5fccad9e
commit
4aa8570107
1 changed files with 7 additions and 0 deletions
|
@ -30,6 +30,7 @@ from homeassistant.components import media_source, zeroconf
|
|||
from homeassistant.components.media_player import (
|
||||
BrowseError,
|
||||
BrowseMedia,
|
||||
MediaPlayerDeviceClass,
|
||||
MediaPlayerEntity,
|
||||
MediaPlayerEntityFeature,
|
||||
async_process_play_media_url,
|
||||
|
@ -300,6 +301,12 @@ class CastMediaPlayerEntity(CastDevice, MediaPlayerEntity):
|
|||
name=str(cast_info.friendly_name),
|
||||
)
|
||||
|
||||
if cast_info.cast_info.cast_type in [
|
||||
pychromecast.const.CAST_TYPE_AUDIO,
|
||||
pychromecast.const.CAST_TYPE_GROUP,
|
||||
]:
|
||||
self._attr_device_class = MediaPlayerDeviceClass.SPEAKER
|
||||
|
||||
async def async_added_to_hass(self):
|
||||
"""Create chromecast object when added to hass."""
|
||||
self._async_setup(self.entity_id)
|
||||
|
|
Loading…
Add table
Reference in a new issue