mirror of
https://github.com/home-assistant/core.git
synced 2025-07-20 03:37:07 +00:00
Migrate trend to use async_update_entry to alter config entries (#110408)
This commit is contained in:
parent
5c60ff19e9
commit
45f23f4458
@ -37,14 +37,17 @@ async def mock_setup_component(
|
|||||||
"""Set up the trend component."""
|
"""Set up the trend component."""
|
||||||
|
|
||||||
async def _setup_func(component_params: dict[str, Any]) -> None:
|
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)
|
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)
|
assert await hass.config_entries.async_setup(config_entry.entry_id)
|
||||||
await hass.async_block_till_done()
|
await hass.async_block_till_done()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user