diff --git a/custom_components/openai_tts/config_flow.py b/custom_components/openai_tts/config_flow.py index 6df6fd9..0afdb14 100644 --- a/custom_components/openai_tts/config_flow.py +++ b/custom_components/openai_tts/config_flow.py @@ -17,7 +17,8 @@ async def validate_input(user_input: dict): """ Function to validate provided data""" - if len(user_input[CONF_API_KEY]) != 51: + api_key_length = len(user_input['CONF_API_KEY']) + if not (51 <= api_key_length <= 56): raise WrongAPIKey