Commit Graph

88 Commits (250af90acbc2a68dc2dc05b1b23ee2f8686ddc4c)

Author SHA1 Message Date
Steven Looman cba752c1af
Bump async-upnp-client==0.23.3 (#63282) 2022-01-03 13:42:09 +01:00
Steven Looman cb82169e92
Bump async-upnp-client to 0.23.2 (#62634) 2021-12-22 13:23:22 -10:00
J. Nick Koston 70947b14a3
Improve SSDP callback performance (#62359) 2021-12-19 21:04:45 -08:00
Michael Chisholm f280b03df8
Update async-upnp-client library to 0.23.1 (#62298) 2021-12-18 23:41:32 -06:00
Diego Elio Pettenò 6ce99bfc80
Bump async-upnp-client to 0.23.0 (#62223) 2021-12-17 16:57:02 -06:00
epenet da7c5f4722
Break long lines in discovery_info (#61431) 2021-12-10 12:48:47 +01:00
epenet c05eca1c82
Remove log flooding prevention logic from discovery info (#61243)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-12-08 10:28:26 -10:00
epenet 6a926b41f2
Enable warnings for SsdpServiceInfo (#60756)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-12-01 08:35:39 -10:00
epenet ec1c52d945
Use dataclass for SsdpServiceInfo (#59931)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-11-29 06:10:07 -10:00
epenet 22bdd38583
Use SsdpServiceInfo for SOURCE_SSDP tests (part 4) (#60339)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-11-25 17:13:52 -06:00
epenet f292691b7b
Use SsdpServiceInfo for ssdp tests (part 3) (#60334)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-11-25 11:46:20 -06:00
epenet 2468724378
Use SsdpServiceInfo for ssdp tests (part 2) (#60322)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-11-25 09:45:35 -06:00
epenet 62bf42e421
Introduce SsdpServiceInfo for ssdp discovery (#60284)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-11-24 19:35:15 -06:00
epenet d990fe1957
Update ssdp matching_domain constant (#60283)
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-11-24 07:49:44 -06:00
epenet 9027ee7828
Revert "Add type hints to SSDP (#59840)" (#60270) 2021-11-24 10:14:48 +01:00
epenet 329904dfbb
Add type hints to SSDP (#59840) 2021-11-18 09:49:36 -06:00
Franck Nijhof ddf0941275
Upgrade async-upnp-client to 0.22.12 (#59284) 2021-11-07 07:41:26 -08:00
Michael Chisholm 4f83a251fa
Bump async-upnp-client to 0.22.11 (#58803) 2021-10-31 16:16:50 +01: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
Steven Looman e5e38ace6c
Bump async-upnp-client to 0.22.10 (#58387) 2021-10-25 12:22:19 +02: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
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
Steven Looman dcf60b54ce
Improve SSDP discovery compatibility when device was discovery through an SSDP advertisement (#58133) 2021-10-21 10:57:34 -10:00
J. Nick Koston b86e19143d
Prevent event loop delay / instability from discovery (#57463) 2021-10-13 08:37:14 -07:00
Steven Looman ba83433c64
Fix multiple upnp/ssdp issues (#57314) 2021-10-08 08:57:49 -07:00
Steven Looman 41d2f03b2f
Bump async-upnp-client to 0.22.5 (#56989) 2021-10-03 07:28:41 -10: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
Michael Chisholm 6c2674734a
SSDP starts config flow only for alive devices (#56551)
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-09-27 08:39:22 +02:00
J. Nick Koston 7ab6c82ad2
Drop defusedxml dep from ssdp manifest (#56699) 2021-09-26 19:49:43 -05:00
J. Nick Koston 26e031984b
Ensure sonos always gets ssdp callbacks from searches (#56591) 2021-09-26 17:16:03 -05:00
J. Nick Koston 6399730d2f
Optimize SSDP matching (#56622)
* Optimize SSDP matching

* tweak

* remove

* remove dupe
2021-09-26 16:30:39 -05:00
Steven Looman 73260c5b88
Move parts of ssdp to async_upnp_client (#55540)
* Move parts of ssdp to async_upnp_client

* Fix test for environments with multiple sources

* Fix sonos tests

* More fixes/changes

* More fixes

* Use async_upnp_client==0.21.0

* Pylint/test fixes

* More changes after review

* Fix tests

* Improve testing

* Fix mypy

* Fix yamaha_musiccast tests?

* Changes after review

* Pylint

* Reduce calls to combined_headers

* Update to async_upnp_client==0.21.1

* Update to async_upnp_client==0.21.2

* use as_dict

Co-authored-by: J. Nick Koston <nick@koston.org>
2021-09-11 13:38:16 -10:00
J. Nick Koston 25b39b36e7
Ignore missing devices when in ssdp unsee (#55553) 2021-09-03 09:06:07 -07:00
J. Nick Koston 2cc87cb7ab
Retrigger config flow when the ssdp location changes for a UDN (#55343)
Fixes #55229
2021-08-27 09:53:29 -07:00
J. Nick Koston 6d0ce814e7
Add new network apis to reduce code duplication (#54832) 2021-08-18 12:33:26 -05:00
J. Nick Koston 62015f5495
Bump async-upnp-client to 0.20.0, adapt to breaking changes (#54782) 2021-08-18 12:13:59 +02:00
Steven Looman 2c1728022d
Use ssdp callbacks in upnp (#53840) 2021-08-13 11:13:25 -05:00
J. Nick Koston 219348d573
Skip each ssdp listener that fails to bind (#53670) 2021-07-29 18:07:52 +02:00
Steven Looman 34b1ab5f5c
Upgrade to async-upnp-client==0.19.1 (#53288) 2021-07-21 14:29:27 -07:00
Ville Skyttä 470f2dd73f
Upgrade pyupgrade to 2.21.2, apply its changes (#52987) 2021-07-19 10:46:09 +02:00
J. Nick Koston 574cb03acc
Send ssdp requests to ipv4 broadcast as well (#52760)
* Send ssdp requests to 255.255.255.255 as well

- This matches pysonos behavior and may fix reports of
  inability to discover some sonos devices
  https://github.com/amelchio/pysonos/blob/master/pysonos/discovery.py#L120

* Update homeassistant/components/ssdp/__init__.py
2021-07-11 17:03:48 -04:00
Steven Looman a127131c1b
Upgrade async_upnp_client to 0.19.0 (#52019) 2021-06-20 18:17:39 +02:00
J. Nick Koston ccf4b5a265
Move remaining code out of netdisco to eliminate as SSDP dependency (#51588) 2021-06-07 22:12:33 +02:00
J. Nick Koston 12ac4109f4
Ensure ssdp can callback messages that do not have an ST (#51436)
* Ensure ssdp can callback messages that do not have an ST

Sonos sends unsolicited messages when the device reboots. We want
to capture these to ensure we can recover the subscriptions as soon
as the device reboots

* Update homeassistant/components/ssdp/__init__.py

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

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
2021-06-05 09:23:51 +02:00
J. Nick Koston c1111afef8
Allow registering a callback to ssdp that matches any key value (#51382) 2021-06-03 08:26:37 -10:00
J. Nick Koston 32dc62a996
Handle empty ssdp descriptions in the cache (#51253) 2021-05-29 22:50:48 -05:00
J. Nick Koston fb50cf9840
Add network and callback support to SSDP (#51019)
Co-authored-by: Ruslan Sayfutdinov <ruslan@sayfutdinov.com>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-05-28 21:18:59 -05:00
J. Nick Koston 60e65a4bc2
Bump async-upnp-client to 0.18.0 (#51017)
- Adds support for a long running SSDP listener
2021-05-24 13:50:40 +02:00
Franck Nijhof aa6b26c9ff
Upgrade defusedxml to 0.7.1 (#50671) 2021-05-15 19:41:34 +02:00