1
0
mirror of https://github.com/home-assistant/core.git synced 2026-05-08 09:38:58 +01:00

Refactor persistent notification to no longer route all data via a service (#57157)

* Convert persistent notification tests to async

* Create/dismiss persistent notifications in exposed functions, not service calls

* Fix notify persistent_notification

* Remove setting up persistent_notification

* Drop more setups

* Empty methods

* Undeprecate sync methods because too big task

* Fix setup clearing notifications

* Fix a bunch of tests

* Fix more tests

* Uno mas

* Test persistent notification events

* Clean up stale comment

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
Paulus Schoutsen
2021-10-07 03:58:00 -07:00
committed by GitHub
parent 750dd9186e
commit a4d9019ffc
198 changed files with 848 additions and 1114 deletions
+2 -5
View File
@@ -7,7 +7,7 @@ from homeassistant import core, loader
from homeassistant.components import http, hue
from homeassistant.components.hue import light as hue_light
from tests.common import MockModule, async_mock_service, mock_integration
from tests.common import MockModule, mock_integration
async def test_component_dependencies(hass):
@@ -69,13 +69,10 @@ def test_component_loader_non_existing(hass):
async def test_component_wrapper(hass):
"""Test component wrapper."""
calls = async_mock_service(hass, "persistent_notification", "create")
components = loader.Components(hass)
components.persistent_notification.async_create("message")
await hass.async_block_till_done()
assert len(calls) == 1
assert len(hass.states.async_entity_ids("persistent_notification")) == 1
async def test_helpers_wrapper(hass):