1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00:00

Reload ESPHome config entries when dashboard info received (#86174)

This commit is contained in:
Paulus Schoutsen
2023-01-18 11:59:55 -05:00
committed by GitHub
parent c40c37e9ee
commit 29337bc6eb
10 changed files with 106 additions and 70 deletions

View File

@@ -37,21 +37,20 @@ async def test_update_entity(
hass,
mock_config_entry,
mock_device_info,
mock_dashboard,
devices_payload,
expected_state,
expected_attributes,
):
"""Test ESPHome update entity."""
async_set_dashboard_info(hass, "mock-addon-slug", "mock-addon-host", 1234)
mock_dashboard["configured"] = devices_payload
await async_set_dashboard_info(hass, "mock-addon-slug", "mock-addon-host", 1234)
mock_config_entry.add_to_hass(hass)
with patch(
"homeassistant.components.esphome.update.DomainData.get_entry_data",
return_value=Mock(available=True, device_info=mock_device_info),
), patch(
"homeassistant.components.esphome.dashboard.ESPHomeDashboardAPI.get_devices",
return_value={"configured": devices_payload},
):
assert await hass.config_entries.async_forward_entry_setup(
mock_config_entry, "update"