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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
198 changed files with 848 additions and 1114 deletions

View file

@ -3,7 +3,7 @@ from unittest.mock import patch
from aiohttp import ClientConnectionError, ClientResponseError
from homeassistant import config_entries, data_entry_flow, setup
from homeassistant import config_entries, data_entry_flow
from homeassistant.components.nightscout.const import DOMAIN
from homeassistant.components.nightscout.utils import hash_from_url
from homeassistant.const import CONF_URL
@ -20,7 +20,7 @@ CONFIG = {CONF_URL: "https://some.url:1234"}
async def test_form(hass):
"""Test we get the user initiated form."""
await setup.async_setup_component(hass, "persistent_notification", {})
result = await hass.config_entries.flow.async_init(
DOMAIN, context={"source": config_entries.SOURCE_USER}
)