Skip to content

Commit

Permalink
Fix config option validation (#49)
Browse files Browse the repository at this point in the history
  • Loading branch information
carleeno authored Oct 12, 2023
1 parent bc980d7 commit 0ebb130
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 8 deletions.
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"
}
}
}
}
}
}

0 comments on commit 0ebb130

Please sign in to comment.