Fix Telegram bot proxy URL not initialized when creating a new bot (#147707)

This commit is contained in:
hanwg 2025-07-01 02:16:45 +08:00 committed by Franck Nijhof
parent ae48e3716e
commit 6dc464ad73
No known key found for this signature in database
GPG Key ID: AB33ADACE7101952
2 changed files with 7 additions and 1 deletions

View File

@ -328,6 +328,9 @@ class TelgramBotConfigFlow(ConfigFlow, domain=DOMAIN):
# validate connection to Telegram API
errors: dict[str, str] = {}
user_input[CONF_PROXY_URL] = user_input[SECTION_ADVANCED_SETTINGS].get(
CONF_PROXY_URL
)
bot_name = await self._validate_bot(
user_input, errors, description_placeholders
)
@ -350,7 +353,9 @@ class TelgramBotConfigFlow(ConfigFlow, domain=DOMAIN):
data={
CONF_PLATFORM: user_input[CONF_PLATFORM],
CONF_API_KEY: user_input[CONF_API_KEY],
CONF_PROXY_URL: user_input["advanced_settings"].get(CONF_PROXY_URL),
CONF_PROXY_URL: user_input[SECTION_ADVANCED_SETTINGS].get(
CONF_PROXY_URL
),
},
options={
# this value may come from yaml import

View File

@ -117,6 +117,7 @@ async def test_reconfigure_flow_broadcast(
assert result["type"] is FlowResultType.ABORT
assert result["reason"] == "reconfigure_successful"
assert mock_webhooks_config_entry.data[CONF_PLATFORM] == PLATFORM_BROADCAST
assert mock_webhooks_config_entry.data[CONF_PROXY_URL] == "https://test"
async def test_reconfigure_flow_webhooks(