Skip to content

Commit aaeb55b

Browse files
authored
Fix influxdb reconfigure for v1 configuration (home-assistant#170448)
1 parent 1f5cb05 commit aaeb55b

2 files changed

Lines changed: 36 additions & 1 deletion

File tree

homeassistant/components/influxdb/config_flow.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,9 @@ async def async_step_reconfigure_v1(
290290
scheme="https" if entry.data.get(CONF_SSL) else "http",
291291
host=entry.data.get(CONF_HOST, ""),
292292
port=entry.data.get(CONF_PORT),
293-
path=entry.data.get(CONF_PATH, ""),
293+
path=""
294+
if entry.data.get(CONF_PATH) is None
295+
else entry.data[CONF_PATH],
294296
)
295297
)
296298

tests/components/influxdb/test_config_flow.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,39 @@ async def test_single_instance_import(
783783
},
784784
"new_db (newhost)",
785785
),
786+
(
787+
DEFAULT_API_VERSION,
788+
{
789+
CONF_API_VERSION: DEFAULT_API_VERSION,
790+
CONF_HOST: "localhost",
791+
CONF_PORT: 8086,
792+
CONF_USERNAME: "user",
793+
CONF_PASSWORD: "pass",
794+
CONF_DB_NAME: "home_assistant",
795+
CONF_SSL: False,
796+
CONF_PATH: None,
797+
CONF_VERIFY_SSL: False,
798+
},
799+
{
800+
CONF_URL: "https://newhost:9999",
801+
CONF_VERIFY_SSL: True,
802+
CONF_DB_NAME: "new_db",
803+
CONF_USERNAME: "new_user",
804+
CONF_PASSWORD: "new_pass",
805+
},
806+
{
807+
CONF_API_VERSION: DEFAULT_API_VERSION,
808+
CONF_HOST: "newhost",
809+
CONF_PORT: 9999,
810+
CONF_USERNAME: "new_user",
811+
CONF_PASSWORD: "new_pass",
812+
CONF_DB_NAME: "new_db",
813+
CONF_SSL: True,
814+
CONF_PATH: "/",
815+
CONF_VERIFY_SSL: True,
816+
},
817+
"new_db (newhost)",
818+
),
786819
],
787820
indirect=["mock_client"],
788821
)

0 commit comments

Comments
 (0)