From 45f23f4458637ebc6e72f679796de677f9cd5d8d Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 12 Feb 2024 14:38:56 -0600 Subject: [PATCH] Migrate trend to use async_update_entry to alter config entries (#110408) --- tests/components/trend/conftest.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/tests/components/trend/conftest.py b/tests/components/trend/conftest.py index cff3831658a..2555492e4fd 100644 --- a/tests/components/trend/conftest.py +++ b/tests/components/trend/conftest.py @@ -37,14 +37,17 @@ async def mock_setup_component( """Set up the trend component.""" async def _setup_func(component_params: dict[str, Any]) -> None: - config_entry.title = "test_trend_sensor" - config_entry.options = { - **config_entry.options, - **component_params, - "name": "test_trend_sensor", - "entity_id": "sensor.test_state", - } config_entry.add_to_hass(hass) + hass.config_entries.async_update_entry( + config_entry, + options={ + **config_entry.options, + **component_params, + "name": "test_trend_sensor", + "entity_id": "sensor.test_state", + }, + title="test_trend_sensor", + ) assert await hass.config_entries.async_setup(config_entry.entry_id) await hass.async_block_till_done()