1
0
mirror of https://github.com/home-assistant/core.git synced 2026-02-15 07:36:16 +00:00

Fix config flow bug for Telegram bot (#162555)

This commit is contained in:
hanwg
2026-02-09 04:32:51 +08:00
committed by GitHub
parent 10497c2bf4
commit 2177b494b9
2 changed files with 4 additions and 3 deletions

View File

@@ -237,9 +237,9 @@ class TelgramBotConfigFlow(ConfigFlow, domain=DOMAIN):
# validate connection to Telegram API
errors: dict[str, str] = {}
user_input[CONF_API_ENDPOINT] = (
user_input[SECTION_ADVANCED_SETTINGS][CONF_API_ENDPOINT],
)
user_input[CONF_API_ENDPOINT] = user_input[SECTION_ADVANCED_SETTINGS][
CONF_API_ENDPOINT
]
user_input[CONF_PROXY_URL] = user_input[SECTION_ADVANCED_SETTINGS].get(
CONF_PROXY_URL
)

View File

@@ -574,6 +574,7 @@ async def test_duplicate_entry(hass: HomeAssistant) -> None:
assert result["type"] is FlowResultType.CREATE_ENTRY
assert result["data"][CONF_PLATFORM] == PLATFORM_BROADCAST
assert result["data"][CONF_API_KEY] == "mock api key"
assert result["data"][CONF_API_ENDPOINT] == "http://mock_api_endpoint"
assert result["options"][ATTR_PARSER] == PARSER_MD
# test: import 2nd entry failed due to duplicate