* Add tts entity * Add tts entity and tests * Re-add name to TextToSpeechEntity * Fix linting * Fix ruff linting * Support voice attr (unused) * Remove async_get_text_to_speech_entity * Move name property to Wyoming TTS entity * Fix id --------- Co-authored-by: Martin Hjelmare <marhje52@gmail.com> Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
23 lines
704 B
Python
23 lines
704 B
Python
"""Test init."""
|
|
from unittest.mock import patch
|
|
|
|
from homeassistant.config_entries import ConfigEntry
|
|
from homeassistant.core import HomeAssistant
|
|
|
|
|
|
async def test_cannot_connect(
|
|
hass: HomeAssistant, stt_config_entry: ConfigEntry
|
|
) -> None:
|
|
"""Test we handle cannot connect error."""
|
|
with patch(
|
|
"homeassistant.components.wyoming.data.load_wyoming_info",
|
|
return_value=None,
|
|
):
|
|
assert not await hass.config_entries.async_setup(stt_config_entry.entry_id)
|
|
|
|
|
|
async def test_unload(
|
|
hass: HomeAssistant, stt_config_entry: ConfigEntry, init_wyoming_stt
|
|
) -> None:
|
|
"""Test unload."""
|
|
assert await hass.config_entries.async_unload(stt_config_entry.entry_id)
|