Remove confusing warning for TTS without entity_id (#21927)
parent
85dc5fe4d5
commit
49014ac13f
|
@ -22,7 +22,7 @@ from homeassistant.components.media_player.const import (
|
|||
ATTR_MEDIA_CONTENT_ID, ATTR_MEDIA_CONTENT_TYPE, MEDIA_TYPE_MUSIC,
|
||||
SERVICE_PLAY_MEDIA)
|
||||
from homeassistant.components.media_player.const import DOMAIN as DOMAIN_MP
|
||||
from homeassistant.const import ATTR_ENTITY_ID
|
||||
from homeassistant.const import ATTR_ENTITY_ID, ENTITY_MATCH_ALL
|
||||
from homeassistant.core import callback
|
||||
from homeassistant.exceptions import HomeAssistantError
|
||||
from homeassistant.helpers import config_per_platform
|
||||
|
@ -126,7 +126,7 @@ async def async_setup(hass, config):
|
|||
|
||||
async def async_say_handle(service):
|
||||
"""Service handle for say."""
|
||||
entity_ids = service.data.get(ATTR_ENTITY_ID)
|
||||
entity_ids = service.data.get(ATTR_ENTITY_ID, ENTITY_MATCH_ALL)
|
||||
message = service.data.get(ATTR_MESSAGE)
|
||||
cache = service.data.get(ATTR_CACHE)
|
||||
language = service.data.get(ATTR_LANGUAGE)
|
||||
|
@ -144,11 +144,9 @@ async def async_setup(hass, config):
|
|||
data = {
|
||||
ATTR_MEDIA_CONTENT_ID: url,
|
||||
ATTR_MEDIA_CONTENT_TYPE: MEDIA_TYPE_MUSIC,
|
||||
ATTR_ENTITY_ID: entity_ids,
|
||||
}
|
||||
|
||||
if entity_ids:
|
||||
data[ATTR_ENTITY_ID] = entity_ids
|
||||
|
||||
await hass.services.async_call(
|
||||
DOMAIN_MP, SERVICE_PLAY_MEDIA, data, blocking=True)
|
||||
|
||||
|
|
Loading…
Reference in New Issue