mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 22:37:11 +00:00
Set Google Cast audio devices as speakers (#73832)
This commit is contained in:
parent
ef5fccad9e
commit
4aa8570107
@ -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…
x
Reference in New Issue
Block a user