Migrate trend to use async_update_entry to alter config entries (#110408)
This commit is contained in:
parent
5c60ff19e9
commit
45f23f4458
1 changed files with 10 additions and 7 deletions
|
@ -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()
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue