core/homeassistant/components/dlna_dmr
Michael Chisholm 667e730946
Improve dlna_dmr code quality (#56886)
* Listen for config updates from DlnaDmrEntity.async_added_to_hass

Use `Entity.async_on_remove` for dealing with callback cancellation,
instead of re-inventing the wheel with `_remove_ssdp_callbacks`.

* Use async_write_ha_state within async methods

* Import YAML config from async_setup_platform

* Import flow prompts user when device is uncontactable during migration

When config flow is able to contact a device, or when it has information
from SSDP, it will create config entries without error. If the device is
uncontactable at this point then it will appear as unavailable in HA
until it is turned on again.

When import flow cannot migrate an entry because it needs to contact the
device and can't, it will notify the user with a config flow form.

* Don't del unused parameters, HA pylint doesn't care

* Remove unused imports from tests

* Abort config flow at earliest opportunity

* Return async_abort instead of raising AbortFlow

* Consolidate config entry test cleanup into a single function

* fixup! Consolidate config entry test cleanup into a single function

Revert "Consolidate config entry test cleanup into a single function"

This reverts commit 8220da7263.

* Check resource acquisition/release in specific tests

* fixup! Check resource acquisition/release in specific tests

* Remove unused network dependency from manifest

* _on_event runs in async context

* Call async_write_ha_state directly (not via shedule_update)

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-10-07 22:14:00 +02:00
..
translations Improve dlna_dmr code quality (#56886) 2021-10-07 22:14:00 +02:00
__init__.py Improve dlna_dmr code quality (#56886) 2021-10-07 22:14:00 +02:00
config_flow.py Improve dlna_dmr code quality (#56886) 2021-10-07 22:14:00 +02:00
const.py Provide most media metadata in DlnaDmrEntity (#56728) 2021-09-28 19:37:23 -05:00
data.py Improve dlna_dmr code quality (#56886) 2021-10-07 22:14:00 +02:00
manifest.json Improve dlna_dmr code quality (#56886) 2021-10-07 22:14:00 +02:00
media_player.py Improve dlna_dmr code quality (#56886) 2021-10-07 22:14:00 +02:00
strings.json Improve dlna_dmr code quality (#56886) 2021-10-07 22:14:00 +02:00