Fix typo in ElevenLabs (#133819)

This commit is contained in:
Simon 2024-12-22 18:26:15 +00:00 committed by GitHub
parent 84a3a9d495
commit a2aba77973
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 9 additions and 11 deletions

View File

@ -35,10 +35,10 @@ class ElevenLabsData:
model: Model model: Model
type EleventLabsConfigEntry = ConfigEntry[ElevenLabsData] type ElevenLabsConfigEntry = ConfigEntry[ElevenLabsData]
async def async_setup_entry(hass: HomeAssistant, entry: EleventLabsConfigEntry) -> bool: async def async_setup_entry(hass: HomeAssistant, entry: ElevenLabsConfigEntry) -> bool:
"""Set up ElevenLabs text-to-speech from a config entry.""" """Set up ElevenLabs text-to-speech from a config entry."""
entry.add_update_listener(update_listener) entry.add_update_listener(update_listener)
httpx_client = get_async_client(hass) httpx_client = get_async_client(hass)
@ -60,15 +60,13 @@ async def async_setup_entry(hass: HomeAssistant, entry: EleventLabsConfigEntry)
return True return True
async def async_unload_entry( async def async_unload_entry(hass: HomeAssistant, entry: ElevenLabsConfigEntry) -> bool:
hass: HomeAssistant, entry: EleventLabsConfigEntry
) -> bool:
"""Unload a config entry.""" """Unload a config entry."""
return await hass.config_entries.async_unload_platforms(entry, PLATFORMS) return await hass.config_entries.async_unload_platforms(entry, PLATFORMS)
async def update_listener( async def update_listener(
hass: HomeAssistant, config_entry: EleventLabsConfigEntry hass: HomeAssistant, config_entry: ElevenLabsConfigEntry
) -> None: ) -> None:
"""Handle options update.""" """Handle options update."""
await hass.config_entries.async_reload(config_entry.entry_id) await hass.config_entries.async_reload(config_entry.entry_id)

View File

@ -19,7 +19,7 @@ from homeassistant.helpers.selector import (
SelectSelectorConfig, SelectSelectorConfig,
) )
from . import EleventLabsConfigEntry from . import ElevenLabsConfigEntry
from .const import ( from .const import (
CONF_CONFIGURE_VOICE, CONF_CONFIGURE_VOICE,
CONF_MODEL, CONF_MODEL,
@ -92,7 +92,7 @@ class ElevenLabsConfigFlow(ConfigFlow, domain=DOMAIN):
@staticmethod @staticmethod
def async_get_options_flow( def async_get_options_flow(
config_entry: EleventLabsConfigEntry, config_entry: ElevenLabsConfigEntry,
) -> OptionsFlow: ) -> OptionsFlow:
"""Create the options flow.""" """Create the options flow."""
return ElevenLabsOptionsFlow(config_entry) return ElevenLabsOptionsFlow(config_entry)
@ -101,7 +101,7 @@ class ElevenLabsConfigFlow(ConfigFlow, domain=DOMAIN):
class ElevenLabsOptionsFlow(OptionsFlow): class ElevenLabsOptionsFlow(OptionsFlow):
"""ElevenLabs options flow.""" """ElevenLabs options flow."""
def __init__(self, config_entry: EleventLabsConfigEntry) -> None: def __init__(self, config_entry: ElevenLabsConfigEntry) -> None:
"""Initialize options flow.""" """Initialize options flow."""
self.api_key: str = config_entry.data[CONF_API_KEY] self.api_key: str = config_entry.data[CONF_API_KEY]
# id -> name # id -> name

View File

@ -22,7 +22,7 @@ from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.device_registry import DeviceEntryType, DeviceInfo from homeassistant.helpers.device_registry import DeviceEntryType, DeviceInfo
from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.entity_platform import AddEntitiesCallback
from . import EleventLabsConfigEntry from . import ElevenLabsConfigEntry
from .const import ( from .const import (
CONF_OPTIMIZE_LATENCY, CONF_OPTIMIZE_LATENCY,
CONF_SIMILARITY, CONF_SIMILARITY,
@ -56,7 +56,7 @@ def to_voice_settings(options: MappingProxyType[str, Any]) -> VoiceSettings:
async def async_setup_entry( async def async_setup_entry(
hass: HomeAssistant, hass: HomeAssistant,
config_entry: EleventLabsConfigEntry, config_entry: ElevenLabsConfigEntry,
async_add_entities: AddEntitiesCallback, async_add_entities: AddEntitiesCallback,
) -> None: ) -> None:
"""Set up ElevenLabs tts platform via config entry.""" """Set up ElevenLabs tts platform via config entry."""