Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix config option validation #49

Merged
merged 1 commit into from
Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 13 additions & 4 deletions custom_components/elevenlabs_tts/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,19 @@ async def async_step_init(self, user_input=None):
default=self.config_entry.options.get(
CONF_STABILITY, DEFAULT_STABILITY
),
): float,
): vol.All(
vol.Coerce(float),
vol.Range(min=0, max=1),
),
vol.Optional(
CONF_SIMILARITY,
default=self.config_entry.options.get(
CONF_SIMILARITY, DEFAULT_SIMILARITY
),
): float,
): vol.All(
vol.Coerce(float),
vol.Range(min=0, max=1),
),
vol.Optional(
CONF_MODEL,
default=self.config_entry.options.get(
Expand All @@ -129,13 +135,16 @@ async def async_step_init(self, user_input=None):
default=self.config_entry.options.get(
CONF_OPTIMIZE_LATENCY, DEFAULT_OPTIMIZE_LATENCY
),
): int,
): vol.All(int, vol.Range(min=0, max=4)),
vol.Optional(
CONF_STYLE,
default=self.config_entry.options.get(
CONF_STYLE, DEFAULT_STYLE
),
): float,
): vol.All(
vol.Coerce(float),
vol.Range(min=0, max=1),
),
vol.Optional(
CONF_USE_SPEAKER_BOOST,
default=self.config_entry.options.get(
Expand Down
8 changes: 4 additions & 4 deletions custom_components/elevenlabs_tts/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@
"stability": "Set the stability of the speech synthesis",
"similarity": "Set the clarity/similarity boost of the speech synthesis",
"model": "Change the model used for requests",
"optimize_streaming_latency": "Reduce latency at the cost of quality",
"style": "Style Exaggeration(Not supported in Model V1)",
"use_speaker_boost": "Enable or disable speaker boost(Not supported in Model V1)"
"optimize_streaming_latency": "Reduce latency at the cost of quality",
"style": "Style exaggeration, not supported in v1 models",
"use_speaker_boost": "Speaker boost, not supported in v1 models"
}
}
}
}
}
}