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:
@@ -4,6 +4,8 @@ import homeassistant.components.persistent_notification as pn
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.setup import async_setup_component
|
||||
|
||||
from tests.common import async_get_persistent_notifications
|
||||
|
||||
|
||||
async def test_async_send_message(hass: HomeAssistant) -> None:
|
||||
"""Test sending a message to notify.persistent_notification service."""
|
||||
@@ -17,9 +19,9 @@ async def test_async_send_message(hass: HomeAssistant) -> None:
|
||||
)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
entity_ids = hass.states.async_entity_ids(pn.DOMAIN)
|
||||
assert len(entity_ids) == 1
|
||||
notifications = async_get_persistent_notifications(hass)
|
||||
assert len(notifications) == 1
|
||||
notification = notifications[list(notifications)[0]]
|
||||
|
||||
state = hass.states.get(entity_ids[0])
|
||||
assert state.attributes.get("message") == "Hello"
|
||||
assert state.attributes.get("title") == "Test notification"
|
||||
assert notification["message"] == "Hello"
|
||||
assert notification["title"] == "Test notification"
|
||||
|
||||
Reference in New Issue
Block a user