From fdb808b5a8766358f1be73c0d31e044e3717f746 Mon Sep 17 00:00:00 2001 From: sfortis <15342157+sfortis@users.noreply.github.com> Date: Sat, 4 May 2024 10:02:39 +0300 Subject: [PATCH] Update config_flow.py - fixed api key length --- custom_components/openai_tts/config_flow.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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