Skip to content

Commit

Permalink
Merge e0673c1 into 9ab543a
Browse files Browse the repository at this point in the history
  • Loading branch information
amelchio committed Mar 11, 2019
2 parents 9ab543a + e0673c1 commit 6d0d637
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions homeassistant/components/tts/__init__.py
Expand Up @@ -22,7 +22,7 @@
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
Expand Down Expand Up @@ -126,7 +126,7 @@ async def async_setup_platform(p_type, p_config, disc_info=None):

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)
Expand All @@ -144,11 +144,9 @@ async def async_say_handle(service):
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)

Expand Down

0 comments on commit 6d0d637

Please sign in to comment.