1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-24 21:06:19 +00: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

View File

@@ -22,14 +22,13 @@ from homeassistant.components.smartthings.const import (
from homeassistant.config import async_process_ha_core_config
from homeassistant.exceptions import ConfigEntryNotReady
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.setup import async_setup_component
from tests.common import MockConfigEntry
async def test_migration_creates_new_flow(hass, smartthings_mock, config_entry):
"""Test migration deletes app and creates new flow."""
assert await async_setup_component(hass, "persistent_notification", {})
config_entry.version = 1
config_entry.add_to_hass(hass)
@@ -55,7 +54,7 @@ async def test_unrecoverable_api_errors_create_new_flow(
403 (forbidden/not found): Occurs when the app or installed app could
not be retrieved/found (likely deleted?)
"""
assert await async_setup_component(hass, "persistent_notification", {})
config_entry.add_to_hass(hass)
request_info = Mock(real_url="http://example.com")
smartthings_mock.app.side_effect = ClientResponseError(