Make camera source check faster (#51035)
parent
e964c607a3
commit
6a7968593d
|
@ -696,10 +696,13 @@ async def async_handle_play_stream_service(
|
|||
|
||||
# It is required to send a different payload for cast media players
|
||||
entity_ids = service_call.data[ATTR_MEDIA_PLAYER]
|
||||
sources = entity_sources(hass)
|
||||
cast_entity_ids = [
|
||||
entity
|
||||
for entity, source in entity_sources(hass).items()
|
||||
if entity in entity_ids and source["domain"] == "cast"
|
||||
for entity in entity_ids
|
||||
# All entities should be in sources. This extra guard is to
|
||||
# avoid people writing to the state machine and breaking it.
|
||||
if entity in sources and sources[entity]["domain"] == "cast"
|
||||
]
|
||||
other_entity_ids = list(set(entity_ids) - set(cast_entity_ids))
|
||||
|
||||
|
|
Loading…
Reference in New Issue