Commit graph

93 commits

Author SHA1 Message Date
Ben Edmunds
c93d389544
Bump async-upnp-client to 0.23.5 () 2022-02-08 20:27:16 +02:00
J. Nick Koston
5b755b74fb
Add loggers to integration manifest.json () 2022-01-28 13:37:53 -08:00
J. Nick Koston
30eacdbea0
Change ssdp scanning interval to 2 minutes () 2022-01-22 11:12:58 -06:00
Michael Chisholm
45b8684b37
Bump async-upnp-client to 0.23.4 () 2022-01-17 14:55:07 +01:00
Marc Mueller
67c35652f0
Update typing - collections.abc (2) () 2022-01-12 09:04:37 +01:00
Steven Looman
cba752c1af
Bump async-upnp-client==0.23.3 () 2022-01-03 13:42:09 +01:00
Steven Looman
cb82169e92
Bump async-upnp-client to 0.23.2 () 2021-12-22 13:23:22 -10:00
J. Nick Koston
70947b14a3
Improve SSDP callback performance () 2021-12-19 21:04:45 -08:00
Michael Chisholm
f280b03df8
Update async-upnp-client library to 0.23.1 () 2021-12-18 23:41:32 -06:00
Diego Elio Pettenò
6ce99bfc80
Bump async-upnp-client to 0.23.0 () 2021-12-17 16:57:02 -06:00
epenet
da7c5f4722
Break long lines in discovery_info () 2021-12-10 12:48:47 +01:00
epenet
c05eca1c82
Remove log flooding prevention logic from discovery info ()
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-12-08 10:28:26 -10:00
epenet
6a926b41f2
Enable warnings for SsdpServiceInfo ()
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-12-01 08:35:39 -10:00
epenet
ec1c52d945
Use dataclass for SsdpServiceInfo ()
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) ()
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) ()
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) ()
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-11-25 09:45:35 -06:00
epenet
62bf42e421
Introduce SsdpServiceInfo for ssdp discovery ()
Co-authored-by: epenet <epenet@users.noreply.github.com>
2021-11-24 19:35:15 -06:00
epenet
d990fe1957
Update ssdp matching_domain constant ()
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 ()" () 2021-11-24 10:14:48 +01:00
epenet
329904dfbb
Add type hints to SSDP () 2021-11-18 09:49:36 -06:00
Franck Nijhof
ddf0941275
Upgrade async-upnp-client to 0.22.12 () 2021-11-07 07:41:26 -08:00
Michael Chisholm
4f83a251fa
Bump async-upnp-client to 0.22.11 () 2021-10-31 16:16:50 +01:00
Michael Chisholm
44aa1fdc66
dlna_dmr won't support devices that don't provide all DMR services () 2021-10-25 19:54:58 -05:00
Steven Looman
e5e38ace6c
Bump async-upnp-client to 0.22.10 () 2021-10-25 12:22:19 +02:00
Michael Chisholm
ee087c7a05
Discovery ignores DLNA DMR devices when they are better supported by another integration () 2021-10-22 10:26:33 -10:00
J. Nick Koston
4a9209ebc8
Bump async-upnp-client to 0.22.9 ()
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 () 2021-10-21 10:57:34 -10:00
J. Nick Koston
b86e19143d
Prevent event loop delay / instability from discovery () 2021-10-13 08:37:14 -07:00
Steven Looman
ba83433c64
Fix multiple upnp/ssdp issues () 2021-10-08 08:57:49 -07:00
Steven Looman
41d2f03b2f
Bump async-upnp-client to 0.22.5 () 2021-10-03 07:28:41 -10:00
Michael Chisholm
f7d95588f8
Provide most media metadata in DlnaDmrEntity ()
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 ()
* 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 ()
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 () 2021-09-26 19:49:43 -05:00
J. Nick Koston
26e031984b
Ensure sonos always gets ssdp callbacks from searches () 2021-09-26 17:16:03 -05:00
J. Nick Koston
6399730d2f
Optimize SSDP matching ()
* 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 ()
* 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 () 2021-09-03 09:06:07 -07:00
J. Nick Koston
2cc87cb7ab
Retrigger config flow when the ssdp location changes for a UDN ()
Fixes 
2021-08-27 09:53:29 -07:00
J. Nick Koston
6d0ce814e7
Add new network apis to reduce code duplication () 2021-08-18 12:33:26 -05:00
J. Nick Koston
62015f5495
Bump async-upnp-client to 0.20.0, adapt to breaking changes () 2021-08-18 12:13:59 +02:00
Steven Looman
2c1728022d
Use ssdp callbacks in upnp () 2021-08-13 11:13:25 -05:00
J. Nick Koston
219348d573
Skip each ssdp listener that fails to bind () 2021-07-29 18:07:52 +02:00
Steven Looman
34b1ab5f5c
Upgrade to async-upnp-client==0.19.1 () 2021-07-21 14:29:27 -07:00
Ville Skyttä
470f2dd73f
Upgrade pyupgrade to 2.21.2, apply its changes () 2021-07-19 10:46:09 +02:00
J. Nick Koston
574cb03acc
Send ssdp requests to ipv4 broadcast as well ()
* 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 () 2021-06-20 18:17:39 +02:00
J. Nick Koston
ccf4b5a265
Move remaining code out of netdisco to eliminate as SSDP dependency () 2021-06-07 22:12:33 +02:00
J. Nick Koston
12ac4109f4
Ensure ssdp can callback messages that do not have an ST ()
* 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