Commit Graph

28 Commits (6da83b90f7a993f584faeb1af8fc7164320bbea4)

Author SHA1 Message Date
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
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
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 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
Marc Mueller c07646db5d
Update typing syntax (#49480)
* Update typing syntax

* Replace typing imports with ones from collections where possible

* Changes after review
2021-04-20 17:40:41 +02:00
J. Nick Koston 403c6b9e26
Stop ssdp scans when stop event happens (#49140) 2021-04-14 22:23:15 +02:00
J. Nick Koston 39785c5cef
Switch ssdp to be async by using async_upnp_client for scanning (#46554)
SSDP scans no longer runs in the executor

This is an interim step that converts the async_upnp_client
response to netdisco's object to ensure fully backwards
compatibility
2021-02-18 11:00:11 +01:00
Vladimír Záhradník ee55223065
SSDP response decode: replace invalid utf-8 characters (#42681)
* SSDP response decode: replace invalid utf-8 characters

* Add test to validate replaced data

Co-authored-by: Joakim Plate <elupus@ecce.se>
2021-01-31 17:59:14 +01:00
J. Nick Koston 4907996dd6
Guard against empty ssdp locations (#43156) 2020-11-13 09:40:25 +01:00
J. Nick Koston 3661d8380a
Avoid the same task ending up multiple times in the ssdp asyncio.gather (#42815) 2020-11-04 17:25:37 +01:00
J. Nick Koston 6c1078d1ca
Reduce ssdp context switches into the executor (#42045)
* Reduce ssdp context switches into the executor

* no self use
2020-10-18 13:44:01 -05:00
Ville Skyttä eb0af3752c
Add more SSDP discovery data and constants (#39984) 2020-09-14 09:18:09 +02:00
J. Nick Koston d0d0403664
Add zeroconf/homekit/ssdp discovery support for custom components (#38466)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2020-08-05 15:50:56 +02:00
J. Nick Koston 5cf7b1b1bc
Ensure we do not start discovered flows until after the started event has fired (#38047)
* Ensure we do not start discovered flows until after the start event has fired

This change makes zeroconf and ssdp match discovery behavior of not
creating config flows until the start event has been fired.  This
prevents config flow creation/dependency installs for discovered
config flows from competing for cpu time during startup.

* Start discovery/service browser/ssdp when EVENT_HOMEASSISTANT_STARTED is fired instead of EVENT_HOMEASSISTANT_START
2020-07-21 14:18:43 -10:00
Ville Skyttä d236a19139
Include all SSDP data in discovery info (#28197)
* Include all SSDP data in discovery info

* Use UPnP device description as discovery info, inject some SSDP attrs

* Clean up attribute names

* Adapt existing SSDP flows to changed attribute names

* Prefix all SSDP UPnP attribute name constants with ATTR_UPNP, tweak a bit
2019-12-19 19:28:03 +02:00
Bas Nijholt 23b92b2a56 Sort imports according to PEP8 for components starting with "S" (#29777) 2019-12-09 14:38:01 +01:00
Ville Skyttä d4c80f160c Add bandit, use to catch known vulnerable XML parsing (#28341)
* Add bandit to pre-commit and CI, use to catch known vulnerable XML parsing

* Use defusedxml instead of direct xml.etree to parse XML

* Move config to tests/bandit.yaml
2019-11-18 09:10:15 +01:00
Ville Skyttä 1679ec3245 SSDP matching improvements (#28285)
* SSDP matching improvements

- support multiple match groups per domain
- require matches on all, not any item in a group
- support matching on all UPnP device description data

* Manifest structure fixes
2019-11-02 12:30:09 -07:00
Ville Skyttä 3c4caaaefc
Add presentation URL to SSDP discovery info (#28196) 2019-10-25 20:09:18 +03:00
Ville Skyttä a54ade1189 Spelling fixes (#25666) 2019-08-02 23:20:06 +02:00
Paulus Schoutsen 4de97abc3a Black 2019-07-31 12:25:30 -07:00
Paulus Schoutsen d7c8adc085
Run SSDP discovery in parallel (#24299) 2019-06-04 11:04:02 -07:00
Robert Svensson 449a7d3fd5 deCONZ migrate to SSDP discovery (#24252)
* Migrate deCONZ to use new SSDP discovery
Add new discovery info manufacturer URL to be able to separate Hue and deCONZ bridges

* Mark deCONZ as migrated in Discovery component

* Fix tests

* Fix Hue discovery ignore deCONZ bridge

* Less snake more badger

* Mushroom

* Fix indentation

* Config flow ignore manufacturer url that is not philips
2019-06-03 09:26:01 -07:00
Paulus Schoutsen 6f299e7245
Improve error handling (#24204) 2019-05-30 16:23:42 -07:00
Paulus Schoutsen 9debbfb1a8
Add SSDP integration (#24090)
* Add SSDP integration

* Fix tests

* Sort all the things

* Add netdisco to test requirements
2019-05-26 19:48:27 -07:00