mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 21:06:19 +00:00
Complete persistent notifications migration (#92828)
* Complete migration of persistent notifications Persistent notifications are no longer stored in the state machine and no longer fire events * Complete migration of persistent notifications Persistent notifications are no longer stored in the state machine and no longer fire events * fixes * fixes * fixes * ws test * update tests * update tests * fix more tests * fix more tests * more fixes * fix * fix person * fix person * keep whitelist * use singleton
This commit is contained in:
@@ -21,7 +21,11 @@ from .common import (
|
||||
simulate_webhook,
|
||||
)
|
||||
|
||||
from tests.common import MockConfigEntry, async_fire_time_changed
|
||||
from tests.common import (
|
||||
MockConfigEntry,
|
||||
async_fire_time_changed,
|
||||
async_get_persistent_notifications,
|
||||
)
|
||||
from tests.components.cloud import mock_cloud
|
||||
|
||||
# Fake webhook thermostat mode change to "Max"
|
||||
@@ -391,7 +395,10 @@ async def test_setup_component_invalid_token_scope(hass: HomeAssistant) -> None:
|
||||
|
||||
assert config_entry.state is config_entries.ConfigEntryState.SETUP_ERROR
|
||||
assert hass.config_entries.async_entries(DOMAIN)
|
||||
assert len(hass.states.async_all()) > 0
|
||||
|
||||
notifications = async_get_persistent_notifications(hass)
|
||||
|
||||
assert len(notifications) > 0
|
||||
|
||||
for config_entry in hass.config_entries.async_entries("netatmo"):
|
||||
await hass.config_entries.async_remove(config_entry.entry_id)
|
||||
@@ -437,7 +444,8 @@ async def test_setup_component_invalid_token(hass: HomeAssistant, config_entry)
|
||||
|
||||
assert config_entry.state is config_entries.ConfigEntryState.SETUP_ERROR
|
||||
assert hass.config_entries.async_entries(DOMAIN)
|
||||
assert len(hass.states.async_all()) > 0
|
||||
notifications = async_get_persistent_notifications(hass)
|
||||
assert len(notifications) > 0
|
||||
|
||||
for config_entry in hass.config_entries.async_entries("netatmo"):
|
||||
await hass.config_entries.async_remove(config_entry.entry_id)
|
||||
|
||||
Reference in New Issue
Block a user