Commit Graph

92 Commits (7c3edf24f2235d0deceffd633666ea0d1285a4a1)

Author SHA1 Message Date
Michael Chisholm 9fa6daf47a
dlna_dmr: Ignore philips tv (#60204) 2021-11-23 23:22:34 +01:00
GitHub Action 9e606abb0c [ci skip] Translation update 2021-11-23 00:13:54 +00:00
GitHub Action 31d4239b64 [ci skip] Translation update 2021-11-22 00:13:02 +00:00
GitHub Action 29dc9de08f [ci skip] Translation update 2021-11-19 00:14:01 +00:00
GitHub Action 9a85c8d894 [ci skip] Translation update 2021-11-18 00:12:48 +00:00
GitHub Action 0228d11546 [ci skip] Translation update 2021-11-16 00:18:33 +00:00
GitHub Action fc539da42b [ci skip] Translation update 2021-11-14 00:12:48 +00:00
GitHub Action 86b12af3dc [ci skip] Translation update 2021-11-10 00:17:39 +00:00
GitHub Action e35b83081e [ci skip] Translation update 2021-11-08 00:12:31 +00:00
Franck Nijhof ddf0941275
Upgrade async-upnp-client to 0.22.12 (#59284) 2021-11-07 07:41:26 -08:00
GitHub Action 332a571bb4 [ci skip] Translation update 2021-11-07 00:12:38 +00:00
GitHub Action 7b59dea67e [ci skip] Translation update 2021-11-06 00:11:41 +00:00
GitHub Action c8d8513a1a [ci skip] Translation update 2021-11-05 00:13:45 +00:00
GitHub Action 2f4b7fe809 [ci skip] Translation update 2021-11-03 00:11:55 +00:00
GitHub Action 0a94badb72 [ci skip] Translation update 2021-11-02 00:12:41 +00:00
Marc Mueller e0c0d00833
Use assignment expressions 39 (#58829) 2021-10-31 18:56:25 +01:00
Michael Chisholm 4f83a251fa
Bump async-upnp-client to 0.22.11 (#58803) 2021-10-31 16:16:50 +01:00
Michael Chisholm ce27fb87c6
dlna_dmr: less eager discovery (#58780) 2021-10-31 16:11:20 +01:00
Marc Mueller 84618fa831
Use assignment expressions 30 (#58714) 2021-10-30 16:33:42 +02:00
GitHub Action 9fafa57074 [ci skip] Translation update 2021-10-30 00:11:34 +00:00
GitHub Action 7d408e3288 [ci skip] Translation update 2021-10-29 00:30:22 +00:00
Michael Chisholm 6cdc372dcb
Add more dlna_dmr media_player services and attributes (#57827) 2021-10-28 16:44:41 -05:00
GitHub Action e75e40f26e [ci skip] Translation update 2021-10-27 00:11:52 +00:00
Michael Chisholm 2ea537e1a6
dlna_dmr will gracefully handle device's rejection of subscription attempt (#58451) 2021-10-26 20:19:18 +02:00
Michael Chisholm 44aa1fdc66
dlna_dmr won't support devices that don't provide all DMR services (#58374) 2021-10-25 19:54:58 -05:00
GitHub Action a9a74e0415 [ci skip] Translation update 2021-10-26 00:12:23 +00:00
Steven Looman e5e38ace6c
Bump async-upnp-client to 0.22.10 (#58387) 2021-10-25 12:22:19 +02:00
GitHub Action 30fb619095 [ci skip] Translation update 2021-10-24 00:12:57 +00:00
GitHub Action 1b42caa34a [ci skip] Translation update 2021-10-23 00:11:40 +00:00
Michael Chisholm ee087c7a05
Discovery ignores DLNA DMR devices when they are better supported by another integration (#57363) 2021-10-22 10:26:33 -10:00
Michael Chisholm 164f09c1f0
Sleep between device requests to detect socket closes (#58087) 2021-10-22 14:22:10 +02:00
Marc Mueller 184e0d7fdf
Use assignment expressions 26 (#58187) 2021-10-22 11:31:17 +02:00
GitHub Action f9d985553c [ci skip] Translation update 2021-10-22 00:14:10 +00:00
J. Nick Koston 4a9209ebc8
Bump async-upnp-client to 0.22.9 (#58185)
Co-authored-by: Steven Looman <steven.looman@gmail.com>
2021-10-21 10:58:34 -10:00
GitHub Action 4634b65924 [ci skip] Translation update 2021-10-21 00:12:43 +00:00
GitHub Action 3855bb43ec [ci skip] Translation update 2021-10-19 00:12:08 +00:00
GitHub Action c76e15149c [ci skip] Translation update 2021-10-17 00:12:27 +00:00
Michael Chisholm aeb00823aa
Log reason for DLNA-DMR device becoming unavailable (#57516) 2021-10-15 19:24:04 +02:00
GitHub Action 8c326198cf [ci skip] Translation update 2021-10-14 00:11:41 +00:00
GitHub Action d55a7e5cc7 [ci skip] Translation update 2021-10-09 00:11:46 +00:00
Steven Looman ba83433c64
Fix multiple upnp/ssdp issues (#57314) 2021-10-08 08:57:49 -07:00
GitHub Action 01d883d7c9 [ci skip] Translation update 2021-10-08 00:13:12 +00:00
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
GitHub Action 8fea54fff7 [ci skip] Translation update 2021-10-07 00:10:57 +00:00
Steven Looman 41d2f03b2f
Bump async-upnp-client to 0.22.5 (#56989) 2021-10-03 07:28:41 -10:00
Michael Chisholm 64d4e8537f
Disable discovery for dlna_dmr until it is more selective (#56950) 2021-10-03 09:09:30 -06:00
GitHub Action 06602e6cc5 [ci skip] Translation update 2021-10-03 00:13:50 +00:00
GitHub Action f42c2f5170 [ci skip] Translation update 2021-10-02 12:59:05 +00:00
Michael Chisholm f7d95588f8
Provide most media metadata in DlnaDmrEntity (#56728)
Co-authored-by: Steven Looman <steven.looman@gmail.com>
2021-09-28 19:37:23 -05:00
Michael Chisholm a28fd7d61b
Config-flow for DLNA-DMR integration (#55267)
* Modernize dlna_dmr component: configflow, test, types

* Support config-flow with ssdp discovery
* Add unit tests
* Enforce strict typing
* Gracefully handle network devices (dis)appearing

* Fix Aiohttp mock response headers type to match actual response class

* Fixes from code review

* Fixes from code review

* Import device config in flow if unavailable at hass start

* Support SSDP advertisements

* Ignore bad BOOTID, fix ssdp:byebye handling

* Only listen for events on interface connected to device

* Release all listeners when entities are removed

* Warn about deprecated dlna_dmr configuration

* Use sublogger for dlna_dmr.config_flow for easier filtering

* Tests for dlna_dmr.data module

* Rewrite DMR tests for HA style

* Fix DMR strings: "Digital Media *Renderer*"

* Update DMR entity state and device info when changed

* Replace deprecated async_upnp_client State with TransportState

* supported_features are dynamic, based on current device state

* Cleanup fully when subscription fails

* Log warnings when device connection fails unexpectedly

* Set PARALLEL_UPDATES to unlimited

* Fix spelling

* Fixes from code review

* Simplify has & can checks to just can, which includes has

* Treat transitioning state as playing (not idle) to reduce UI jerking

* Test if device is usable

* Handle ssdp:update messages properly

* Fix _remove_ssdp_callbacks being shared by all DlnaDmrEntity instances

* Fix tests for transitioning state

* Mock DmrDevice.is_profile_device (added to support embedded devices)

* Use ST & NT SSDP headers to find DMR devices, not deviceType

The deviceType is extracted from the device's description XML, and will not
be what we want when dealing with embedded devices.

* Use UDN from SSDP headers, not device description, as unique_id

The SSDP headers have the UDN of the embedded device that we're interested
in, whereas the device description (`ATTR_UPNP_UDN`) field will always be
for the root device.

* Fix DMR string English localization

* Test config flow with UDN from SSDP headers

* Bump async-upnp-client==0.22.1, fix flake8 error

* fix test for remapping

* DMR HA Device connections based on root and embedded UDN

* DmrDevice's UpnpDevice is now named profile_device

* Use device type from SSDP headers, not device description

* Mark dlna_dmr constants as Final

* Use embedded device UDN and type for unique ID when connected via URL

* More informative connection error messages

* Also match SSDP messages on NT headers

The NT header is to ssdp:alive messages what ST is to M-SEARCH responses.

* Bump async-upnp-client==0.22.2

* fix merge

* Bump async-upnp-client==0.22.3

Co-authored-by: Steven Looman <steven.looman@gmail.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-09-27 15:47:01 -05:00