Import persistent notification (part 4) (#63901)

This commit is contained in:
Erik Montnemery 2022-01-11 16:57:40 +01:00 committed by GitHub
parent 4b6e196606
commit a672dc3437
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 58 additions and 35 deletions

View file

@ -158,9 +158,7 @@ async def test_ws_get_notifications(hass, hass_ws_client):
assert len(notifications) == 0
# Create
hass.components.persistent_notification.async_create(
"test", notification_id="Beer 2"
)
pn.async_create(hass, "test", notification_id="Beer 2")
await client.send_json({"id": 6, "type": "persistent_notification/get"})
msg = await client.receive_json()
assert msg["id"] == 6
@ -186,7 +184,7 @@ async def test_ws_get_notifications(hass, hass_ws_client):
assert notifications[0]["status"] == pn.STATUS_READ
# Dismiss
hass.components.persistent_notification.async_dismiss("Beer 2")
pn.async_dismiss(hass, "Beer 2")
await client.send_json({"id": 8, "type": "persistent_notification/get"})
msg = await client.receive_json()
notifications = msg["result"]