Migrate trend to use async_update_entry to alter config entries (#110408)

This commit is contained in:
J. Nick Koston 2024-02-12 14:38:56 -06:00 committed by GitHub
parent 5c60ff19e9
commit 45f23f4458
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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()