Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
fabio-garavini committed Aug 14, 2024
1 parent 7bb4773 commit 9acf645
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
17 changes: 7 additions & 10 deletions custom_components/openai_whisper_cloud/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,7 @@


async def validate_input(data: dict):
"""Validate the user input allows us to connect.
Data has the keys from DATA_SCHEMA with values provided by the user.
"""
"""Validate the user input."""

if data.get(CONF_TEMPERATURE) is None:
data[CONF_TEMPERATURE] = DEFAULT_TEMPERATURE
Expand Down Expand Up @@ -78,7 +75,7 @@ async def validate_input(data: dict):


class ConfigFlow(ConfigFlow, domain=DOMAIN):
"""Handle a config flow for OpenAI Whisper Cloud."""
"""Handle UI config flow."""

VERSION = 1
MINOR_VERSION = 0
Expand All @@ -88,7 +85,7 @@ async def async_step_user(
user_input: dict[str, Any] | None = None,
errors: dict[str, str] | None = None,
) -> ConfigFlowResult:
"""Handle the initial step."""
"""Handle initial step."""
errors = {}
if user_input is not None:
try:
Expand Down Expand Up @@ -116,16 +113,16 @@ async def async_step_user(


class UnknownError(exceptions.HomeAssistantError):
"""Error to indicate we cannot connect."""
"""Unknown error."""


class UnauthorizedError(exceptions.HomeAssistantError):
"""Error to indicate there is an invalid api_key."""
"""API key valid but doesn't have the rights to use Whisper."""


class InvalidAPIKey(exceptions.HomeAssistantError):
"""Error to indicate there is an invalid api_key."""
"""Invalid api_key error."""


class WhisperModelBlocked(exceptions.HomeAssistantError):
"""Error to indicate there is an invalid api_key."""
"""Whisper not found in the available OpenAI models."""
4 changes: 2 additions & 2 deletions custom_components/openai_whisper_cloud/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
],
"config_flow": true,
"dependencies": [],
"documentation": "https://github.com/fabio-garavini/openai_whisper_cloud",
"issue_tracker": "https://github.com/fabio-garavini/openai_whisper_cloud/issues",
"documentation": "https://github.com/fabio-garavini/ha-openai-whisper-stt-api",
"issue_tracker": "https://github.com/fabio-garavini/ha-openai-whisper-stt-api/issues",
"homekit": {},
"iot_class": "cloud_push",
"requirements": [],
Expand Down
2 changes: 1 addition & 1 deletion custom_components/openai_whisper_cloud/stt.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Support for OpenAI Whisper API speech-to-text service."""
"""OpenAI Whisper API speech-to-text entity."""

from __future__ import annotations

Expand Down

0 comments on commit 9acf645

Please sign in to comment.