From 79adfbc862aed0bd1d7e173b32e011aff7253829 Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Wed, 22 Feb 2023 13:53:00 +0100 Subject: [PATCH] Use load_json_object in tellduslive (#88591) --- homeassistant/components/tellduslive/config_flow.py | 4 ++-- tests/components/tellduslive/test_config_flow.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/tellduslive/config_flow.py b/homeassistant/components/tellduslive/config_flow.py index a181bce11f2..c87b3998a27 100644 --- a/homeassistant/components/tellduslive/config_flow.py +++ b/homeassistant/components/tellduslive/config_flow.py @@ -9,7 +9,7 @@ import voluptuous as vol from homeassistant import config_entries from homeassistant.const import CONF_HOST -from homeassistant.util.json import load_json +from homeassistant.util.json import load_json_object from .const import ( APPLICATION_NAME, @@ -137,7 +137,7 @@ class FlowHandler(config_entries.ConfigFlow, domain=DOMAIN): return await self.async_step_user() conf = await self.hass.async_add_executor_job( - load_json, self.hass.config.path(TELLDUS_CONFIG_FILE) + load_json_object, self.hass.config.path(TELLDUS_CONFIG_FILE) ) host = next(iter(conf)) diff --git a/tests/components/tellduslive/test_config_flow.py b/tests/components/tellduslive/test_config_flow.py index bffcb60b6d1..0eaadae4931 100644 --- a/tests/components/tellduslive/test_config_flow.py +++ b/tests/components/tellduslive/test_config_flow.py @@ -141,7 +141,7 @@ async def test_step_import_load_json_matching_host( flow = init_config_flow(hass) with patch( - "homeassistant.components.tellduslive.config_flow.load_json", + "homeassistant.components.tellduslive.config_flow.load_json_object", return_value={"tellduslive": {}}, ), patch("os.path.isfile"): result = await flow.async_step_import( @@ -156,7 +156,7 @@ async def test_step_import_load_json(hass: HomeAssistant, mock_tellduslive) -> N flow = init_config_flow(hass) with patch( - "homeassistant.components.tellduslive.config_flow.load_json", + "homeassistant.components.tellduslive.config_flow.load_json_object", return_value={"localhost": {}}, ), patch("os.path.isfile"): result = await flow.async_step_import(