mirror of
https://github.com/home-assistant/core.git
synced 2025-04-25 01:38:02 +00:00
Migrate steam_online to use async_forward_entry_setups (#86578)
* Migrate steam_online to use async_forward_entry_setups Replaces deprecated async_setup_platforms with async_forward_entry_setups * fix steam_online tests
This commit is contained in:
parent
a4c52567a7
commit
b507fb1e06
@ -37,7 +37,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
||||
coordinator = SteamDataUpdateCoordinator(hass)
|
||||
await coordinator.async_config_entry_first_refresh()
|
||||
hass.data.setdefault(DOMAIN, {})[entry.entry_id] = coordinator
|
||||
hass.config_entries.async_setup_platforms(entry, PLATFORMS)
|
||||
await hass.config_entries.async_forward_entry_setups(entry, PLATFORMS)
|
||||
|
||||
return True
|
||||
|
||||
|
@ -150,11 +150,10 @@ async def test_options_flow(hass: HomeAssistant) -> None:
|
||||
result["flow_id"],
|
||||
user_input={CONF_ACCOUNTS: [ACCOUNT_1, ACCOUNT_2]},
|
||||
)
|
||||
await hass.async_block_till_done()
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert result["type"] == data_entry_flow.FlowResultType.CREATE_ENTRY
|
||||
assert result["data"] == CONF_OPTIONS_2
|
||||
assert len(er.async_get(hass).entities) == 2
|
||||
|
||||
|
||||
async def test_options_flow_deselect(hass: HomeAssistant) -> None:
|
||||
@ -165,6 +164,10 @@ async def test_options_flow_deselect(hass: HomeAssistant) -> None:
|
||||
result = await hass.config_entries.options.async_init(entry.entry_id)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
with patch_interface(), patch(
|
||||
"homeassistant.components.steam_online.async_setup_entry",
|
||||
return_value=True,
|
||||
):
|
||||
assert result["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result["step_id"] == "init"
|
||||
|
||||
@ -172,6 +175,7 @@ async def test_options_flow_deselect(hass: HomeAssistant) -> None:
|
||||
result["flow_id"],
|
||||
user_input={CONF_ACCOUNTS: []},
|
||||
)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert result["type"] == data_entry_flow.FlowResultType.CREATE_ENTRY
|
||||
assert result["data"] == {CONF_ACCOUNTS: {}}
|
||||
|
Loading…
x
Reference in New Issue
Block a user