This commit is contained in:
Fabian Affolter 2017-01-15 14:53:07 +01:00 committed by GitHub
parent e00e6f9db6
commit 2465aea63b
3 changed files with 10 additions and 10 deletions

View File

@ -2,7 +2,7 @@
Support for the google speech service. Support for the google speech service.
For more details about this component, please refer to the documentation at For more details about this component, please refer to the documentation at
https://home-assistant.io/components/tts/google/ https://home-assistant.io/components/tts.google/
""" """
import asyncio import asyncio
import logging import logging
@ -41,12 +41,12 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
@asyncio.coroutine @asyncio.coroutine
def async_get_engine(hass, config): def async_get_engine(hass, config):
"""Setup Google speech component.""" """Set up Google speech component."""
return GoogleProvider(hass, config[CONF_LANG]) return GoogleProvider(hass, config[CONF_LANG])
class GoogleProvider(Provider): class GoogleProvider(Provider):
"""Google speech api provider.""" """The Google speech API provider."""
def __init__(self, hass, lang): def __init__(self, hass, lang):
"""Init Google TTS service.""" """Init Google TTS service."""

View File

@ -25,7 +25,7 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
def get_engine(hass, config): def get_engine(hass, config):
"""Setup pico speech component.""" """Set up Pico speech component."""
if shutil.which("pico2wave") is None: if shutil.which("pico2wave") is None:
_LOGGER.error("'pico2wave' was not found") _LOGGER.error("'pico2wave' was not found")
return False return False

View File

@ -2,7 +2,7 @@
Support for the voicerss speech service. Support for the voicerss speech service.
For more details about this component, please refer to the documentation at For more details about this component, please refer to the documentation at
https://home-assistant.io/components/tts/voicerss/ https://home-assistant.io/components/tts.voicerss/
""" """
import asyncio import asyncio
import logging import logging
@ -83,12 +83,12 @@ PLATFORM_SCHEMA = PLATFORM_SCHEMA.extend({
@asyncio.coroutine @asyncio.coroutine
def async_get_engine(hass, config): def async_get_engine(hass, config):
"""Setup VoiceRSS speech component.""" """Set up VoiceRSS TTS component."""
return VoiceRSSProvider(hass, config) return VoiceRSSProvider(hass, config)
class VoiceRSSProvider(Provider): class VoiceRSSProvider(Provider):
"""VoiceRSS speech api provider.""" """The VoiceRSS speech API provider."""
def __init__(self, hass, conf): def __init__(self, hass, conf):
"""Init VoiceRSS TTS service.""" """Init VoiceRSS TTS service."""
@ -115,7 +115,7 @@ class VoiceRSSProvider(Provider):
@asyncio.coroutine @asyncio.coroutine
def async_get_tts_audio(self, message, language): def async_get_tts_audio(self, message, language):
"""Load TTS from voicerss.""" """Load TTS from VoiceRSS."""
websession = async_get_clientsession(self.hass) websession = async_get_clientsession(self.hass)
form_data = self._form_data.copy() form_data = self._form_data.copy()
@ -137,11 +137,11 @@ class VoiceRSSProvider(Provider):
if data in ERROR_MSG: if data in ERROR_MSG:
_LOGGER.error( _LOGGER.error(
"Error receive %s from voicerss.", str(data, 'utf-8')) "Error receive %s from VoiceRSS", str(data, 'utf-8'))
return (None, None) return (None, None)
except (asyncio.TimeoutError, aiohttp.errors.ClientError): except (asyncio.TimeoutError, aiohttp.errors.ClientError):
_LOGGER.error("Timeout for voicerss api.") _LOGGER.error("Timeout for VoiceRSS API")
return (None, None) return (None, None)
finally: finally: