From e14eb9fbc593946cf9c4cccea4d239ba1db819c8 Mon Sep 17 00:00:00 2001 From: Rob Bierbooms <31007358+RobBie1221@users.noreply.github.com> Date: Wed, 13 May 2026 10:46:51 +0200 Subject: [PATCH] Fix influxdb reconfigure for v1 configuration (#170448) --- .../components/influxdb/config_flow.py | 4 ++- tests/components/influxdb/test_config_flow.py | 33 +++++++++++++++++++ 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/homeassistant/components/influxdb/config_flow.py b/homeassistant/components/influxdb/config_flow.py index 679566e8a8fb..6884e31332ca 100644 --- a/homeassistant/components/influxdb/config_flow.py +++ b/homeassistant/components/influxdb/config_flow.py @@ -290,7 +290,9 @@ class InfluxDBConfigFlow(ConfigFlow, domain=DOMAIN): scheme="https" if entry.data.get(CONF_SSL) else "http", host=entry.data.get(CONF_HOST, ""), port=entry.data.get(CONF_PORT), - path=entry.data.get(CONF_PATH, ""), + path="" + if entry.data.get(CONF_PATH) is None + else entry.data[CONF_PATH], ) ) diff --git a/tests/components/influxdb/test_config_flow.py b/tests/components/influxdb/test_config_flow.py index 482e68429f3d..94227b77ca7a 100644 --- a/tests/components/influxdb/test_config_flow.py +++ b/tests/components/influxdb/test_config_flow.py @@ -783,6 +783,39 @@ async def test_single_instance_import( }, "new_db (newhost)", ), + ( + DEFAULT_API_VERSION, + { + CONF_API_VERSION: DEFAULT_API_VERSION, + CONF_HOST: "localhost", + CONF_PORT: 8086, + CONF_USERNAME: "user", + CONF_PASSWORD: "pass", + CONF_DB_NAME: "home_assistant", + CONF_SSL: False, + CONF_PATH: None, + CONF_VERIFY_SSL: False, + }, + { + CONF_URL: "https://newhost:9999", + CONF_VERIFY_SSL: True, + CONF_DB_NAME: "new_db", + CONF_USERNAME: "new_user", + CONF_PASSWORD: "new_pass", + }, + { + CONF_API_VERSION: DEFAULT_API_VERSION, + CONF_HOST: "newhost", + CONF_PORT: 9999, + CONF_USERNAME: "new_user", + CONF_PASSWORD: "new_pass", + CONF_DB_NAME: "new_db", + CONF_SSL: True, + CONF_PATH: "/", + CONF_VERIFY_SSL: True, + }, + "new_db (newhost)", + ), ], indirect=["mock_client"], )