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

Fire events when long term statistics is updated (#82492)

* Fire events when long term statistics is updated

* Allow the new events to be subscribed to by anyone

* Address review comments

* Finish renaming events

* Finish renaming events

* Fix do_adhoc_statistics

* Adjust tests

* Adjust tests
This commit is contained in:
Erik Montnemery
2022-11-24 22:01:36 +01:00
committed by GitHub
parent 9f9114cb4a
commit b94e1e9ef8
10 changed files with 108 additions and 23 deletions

View File

@@ -418,14 +418,15 @@ async def test_discovery_requirements_ssdp(hass):
) as mock_process:
await async_get_integration_with_requirements(hass, "ssdp_comp")
assert len(mock_process.mock_calls) == 4
assert len(mock_process.mock_calls) == 5
assert mock_process.mock_calls[0][1][1] == ssdp.requirements
# Ensure zeroconf is a dep for ssdp
assert {
mock_process.mock_calls[1][1][0],
mock_process.mock_calls[2][1][0],
mock_process.mock_calls[3][1][0],
} == {"network", "zeroconf", "http"}
mock_process.mock_calls[4][1][0],
} == {"http", "network", "recorder", "zeroconf"}
@pytest.mark.parametrize(
@@ -447,7 +448,7 @@ async def test_discovery_requirements_zeroconf(hass, partial_manifest):
) as mock_process:
await async_get_integration_with_requirements(hass, "comp")
assert len(mock_process.mock_calls) == 3 # zeroconf also depends on http
assert len(mock_process.mock_calls) == 4 # zeroconf also depends on http
assert mock_process.mock_calls[0][1][1] == zeroconf.requirements