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

@ -125,7 +125,7 @@ async def test_setup_duplicate_config(hass: HomeAssistant, remote: Mock, caplog)
await async_setup_component(hass, SAMSUNGTV_DOMAIN, DUPLICATE)
await hass.async_block_till_done()
assert hass.states.get(ENTITY_ID) is None
assert len(hass.states.async_all()) == 0
assert len(hass.states.async_all("media_player")) == 0
assert "duplicate host entries found" in caplog.text
@ -136,6 +136,6 @@ async def test_setup_duplicate_entries(
await async_setup_component(hass, SAMSUNGTV_DOMAIN, MOCK_CONFIG)
await hass.async_block_till_done()
assert hass.states.get(ENTITY_ID)
assert len(hass.states.async_all()) == 1
assert len(hass.states.async_all("media_player")) == 1
await async_setup_component(hass, SAMSUNGTV_DOMAIN, MOCK_CONFIG)
assert len(hass.states.async_all()) == 1
assert len(hass.states.async_all("media_player")) == 1