mirror of
https://github.com/home-assistant/core.git
synced 2025-07-09 22:37:11 +00:00
Make it non-optional to implement supported_languages in tts.Provider (#91347)
This commit is contained in:
parent
8c1c7e1e4c
commit
b597415b01
@ -1,6 +1,7 @@
|
|||||||
"""Provide functionality for TTS."""
|
"""Provide functionality for TTS."""
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from abc import ABC, abstractmethod
|
||||||
import asyncio
|
import asyncio
|
||||||
from collections.abc import Mapping
|
from collections.abc import Mapping
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
@ -738,7 +739,7 @@ class SpeechManager:
|
|||||||
return data_bytes.getvalue()
|
return data_bytes.getvalue()
|
||||||
|
|
||||||
|
|
||||||
class Provider:
|
class Provider(ABC):
|
||||||
"""Represent a single TTS provider."""
|
"""Represent a single TTS provider."""
|
||||||
|
|
||||||
hass: HomeAssistant | None = None
|
hass: HomeAssistant | None = None
|
||||||
@ -750,9 +751,9 @@ class Provider:
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def supported_languages(self) -> list[str] | None:
|
@abstractmethod
|
||||||
|
def supported_languages(self) -> list[str]:
|
||||||
"""Return a list of supported languages."""
|
"""Return a list of supported languages."""
|
||||||
return None
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def supported_options(self) -> list[str] | None:
|
def supported_options(self) -> list[str] | None:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user