Update ssdp callback matching to support MATCH_ALL (#956)

This commit is contained in:
J. Nick Koston 2021-06-03 14:10:57 -10:00 committed by GitHub
parent efe7943736
commit 371b5b5ca5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -119,6 +119,22 @@ entry.async_on_unload(
) )
``` ```
The below example shows registering to get callbacks when the `x-rincon-bootseq` header is present.
```
from homeassistant.components import ssdp
from homeassistant.const import MATCH_ALL
...
entry.async_on_unload(
ssdp.async_register_callback(
hass, _async_discovered_player, {"x-rincon-bootseq": MATCH_ALL}
)
)
```
## Network ## Network
For integrations that use a discovery method that is not built-in and need to access the user's network adapter configuration, the following helper API should be used. For integrations that use a discovery method that is not built-in and need to access the user's network adapter configuration, the following helper API should be used.