Home Assistant Unofficial Reference 2024.12.1
homeassistant.components.ssdp Namespace Reference

Classes

class  HassUpnpServiceDevice
 
class  IntegrationMatchers
 
class  Scanner
 
class  Server
 
class  SsdpServiceInfo
 

Functions

int _async_find_next_available_port (AddressTupleVXType source)
 
bool _async_headers_match (CaseInsensitiveDict headers, dict[str, str] lower_match_dict)
 
None _async_process_callbacks (HomeAssistant hass, list[SsdpHassJobCallback] callbacks, SsdpServiceInfo discovery_info, SsdpChange ssdp_change)
 
str _format_err (str name, *Any args)
 
str|None _udn_from_usn (str|None usn)
 
set[IPv4Address|IPv6Address] async_build_source_set (HomeAssistant hass)
 
list[SsdpServiceInfoasync_get_discovery_info_by_st (HomeAssistant hass, str st)
 
list[SsdpServiceInfoasync_get_discovery_info_by_udn (HomeAssistant hass, str udn)
 
SsdpServiceInfo|None async_get_discovery_info_by_udn_st (HomeAssistant hass, str udn, str st)
 
Callable[[], None] async_register_callback (HomeAssistant hass, Callable[[SsdpServiceInfo, SsdpChange], Coroutine[Any, Any, None]|None] callback, dict[str, str]|None match_dict=None)
 
bool async_setup (HomeAssistant hass, ConfigType config)
 
SsdpServiceInfo discovery_info_from_headers_and_description (SsdpDevice ssdp_device, CaseInsensitiveDict combined_headers, Mapping[str, Any] info_desc)
 

Variables

 _LOGGER = logging.getLogger(__name__)
 
string ATTR_HA_MATCHING_DOMAINS = "x_homeassistant_matching_domains"
 
string ATTR_NT = "nt"
 
string ATTR_SSDP_BOOTID = "BOOTID.UPNP.ORG"
 
string ATTR_SSDP_EXT = "ssdp_ext"
 
string ATTR_SSDP_LOCATION = "ssdp_location"
 
string ATTR_SSDP_NEXTBOOTID = "NEXTBOOTID.UPNP.ORG"
 
string ATTR_SSDP_NT = "ssdp_nt"
 
string ATTR_SSDP_SERVER = "ssdp_server"
 
string ATTR_SSDP_ST = "ssdp_st"
 
string ATTR_SSDP_UDN = "ssdp_udn"
 
string ATTR_SSDP_USN = "ssdp_usn"
 
string ATTR_ST = "st"
 
string ATTR_UPNP_DEVICE_TYPE = "deviceType"
 
string ATTR_UPNP_FRIENDLY_NAME = "friendlyName"
 
string ATTR_UPNP_MANUFACTURER = "manufacturer"
 
string ATTR_UPNP_MANUFACTURER_URL = "manufacturerURL"
 
string ATTR_UPNP_MODEL_DESCRIPTION = "modelDescription"
 
string ATTR_UPNP_MODEL_NAME = "modelName"
 
string ATTR_UPNP_MODEL_NUMBER = "modelNumber"
 
string ATTR_UPNP_MODEL_URL = "modelURL"
 
string ATTR_UPNP_PRESENTATION_URL = "presentationURL"
 
string ATTR_UPNP_SERIAL = "serialNumber"
 
string ATTR_UPNP_SERVICE_LIST = "serviceList"
 
string ATTR_UPNP_UDN = "UDN"
 
string ATTR_UPNP_UPC = "UPC"
 
 CONFIG_SCHEMA = cv.empty_config_schema(DOMAIN)
 
string DOMAIN = "ssdp"
 
 IPV4_BROADCAST = IPv4Address("255.255.255.255")
 
list PRIMARY_MATCH_KEYS
 
 SCAN_INTERVAL = timedelta(minutes=10)
 
string SSDP_SCANNER = "scanner"
 
 SsdpChange = Enum("SsdpChange", "ALIVE BYEBYE UPDATE")
 
 SsdpHassJobCallback
 
string UPNP_SERVER = "server"
 
int UPNP_SERVER_MAX_PORT = 40100
 
int UPNP_SERVER_MIN_PORT = 40000
 

Detailed Description

The SSDP integration.

Function Documentation

◆ _async_find_next_available_port()

int homeassistant.components.ssdp._async_find_next_available_port ( AddressTupleVXType  source)
private
Get a free TCP port.

Definition at line 764 of file __init__.py.

◆ _async_headers_match()

bool homeassistant.components.ssdp._async_headers_match ( CaseInsensitiveDict  headers,
dict[str, str]   lower_match_dict 
)
private

Definition at line 243 of file __init__.py.

◆ _async_process_callbacks()

None homeassistant.components.ssdp._async_process_callbacks ( HomeAssistant  hass,
list[SsdpHassJobCallback callbacks,
SsdpServiceInfo  discovery_info,
SsdpChange  ssdp_change 
)
private

Definition at line 227 of file __init__.py.

◆ _format_err()

str homeassistant.components.ssdp._format_err ( str  name,
*Any  args 
)
private
Format error message.

Definition at line 143 of file __init__.py.

◆ _udn_from_usn()

str | None homeassistant.components.ssdp._udn_from_usn ( str | None  usn)
private
Get the UDN from the USN.

Definition at line 702 of file __init__.py.

◆ async_build_source_set()

set[IPv4Address | IPv6Address] homeassistant.components.ssdp.async_build_source_set ( HomeAssistant  hass)
Build the list of ssdp sources.

Definition at line 196 of file __init__.py.

◆ async_get_discovery_info_by_st()

list[SsdpServiceInfo] homeassistant.components.ssdp.async_get_discovery_info_by_st ( HomeAssistant  hass,
str   st 
)
Fetch all the entries matching the st.

Definition at line 179 of file __init__.py.

◆ async_get_discovery_info_by_udn()

list[SsdpServiceInfo] homeassistant.components.ssdp.async_get_discovery_info_by_udn ( HomeAssistant  hass,
str   udn 
)
Fetch all the entries matching the udn.

Definition at line 188 of file __init__.py.

◆ async_get_discovery_info_by_udn_st()

SsdpServiceInfo | None homeassistant.components.ssdp.async_get_discovery_info_by_udn_st ( HomeAssistant  hass,
str  udn,
str   st 
)
Fetch the discovery info cache.

Definition at line 170 of file __init__.py.

◆ async_register_callback()

Callable[[], None] homeassistant.components.ssdp.async_register_callback ( HomeAssistant  hass,
Callable[[SsdpServiceInfo, SsdpChange], Coroutine[Any, Any, None] | None]  callback,
dict[str, str] | None   match_dict = None 
)
Register to receive a callback on ssdp broadcast.

Returns a callback that can be used to cancel the registration.

Definition at line 149 of file __init__.py.

◆ async_setup()

bool homeassistant.components.ssdp.async_setup ( HomeAssistant  hass,
ConfigType  config 
)
Set up the SSDP integration.

Definition at line 207 of file __init__.py.

◆ discovery_info_from_headers_and_description()

SsdpServiceInfo homeassistant.components.ssdp.discovery_info_from_headers_and_description ( SsdpDevice  ssdp_device,
CaseInsensitiveDict  combined_headers,
Mapping[str, Any]  info_desc 
)
Convert headers and description to discovery_info.

Definition at line 664 of file __init__.py.

Variable Documentation

◆ _LOGGER

homeassistant.components.ssdp._LOGGER = logging.getLogger(__name__)
private

Definition at line 106 of file __init__.py.

◆ ATTR_HA_MATCHING_DOMAINS

string homeassistant.components.ssdp.ATTR_HA_MATCHING_DOMAINS = "x_homeassistant_matching_domains"

Definition at line 96 of file __init__.py.

◆ ATTR_NT

string homeassistant.components.ssdp.ATTR_NT = "nt"

Definition at line 81 of file __init__.py.

◆ ATTR_SSDP_BOOTID

string homeassistant.components.ssdp.ATTR_SSDP_BOOTID = "BOOTID.UPNP.ORG"

Definition at line 77 of file __init__.py.

◆ ATTR_SSDP_EXT

string homeassistant.components.ssdp.ATTR_SSDP_EXT = "ssdp_ext"

Definition at line 75 of file __init__.py.

◆ ATTR_SSDP_LOCATION

string homeassistant.components.ssdp.ATTR_SSDP_LOCATION = "ssdp_location"

Definition at line 70 of file __init__.py.

◆ ATTR_SSDP_NEXTBOOTID

string homeassistant.components.ssdp.ATTR_SSDP_NEXTBOOTID = "NEXTBOOTID.UPNP.ORG"

Definition at line 78 of file __init__.py.

◆ ATTR_SSDP_NT

string homeassistant.components.ssdp.ATTR_SSDP_NT = "ssdp_nt"

Definition at line 72 of file __init__.py.

◆ ATTR_SSDP_SERVER

string homeassistant.components.ssdp.ATTR_SSDP_SERVER = "ssdp_server"

Definition at line 76 of file __init__.py.

◆ ATTR_SSDP_ST

string homeassistant.components.ssdp.ATTR_SSDP_ST = "ssdp_st"

Definition at line 71 of file __init__.py.

◆ ATTR_SSDP_UDN

string homeassistant.components.ssdp.ATTR_SSDP_UDN = "ssdp_udn"

Definition at line 73 of file __init__.py.

◆ ATTR_SSDP_USN

string homeassistant.components.ssdp.ATTR_SSDP_USN = "ssdp_usn"

Definition at line 74 of file __init__.py.

◆ ATTR_ST

string homeassistant.components.ssdp.ATTR_ST = "st"

Definition at line 80 of file __init__.py.

◆ ATTR_UPNP_DEVICE_TYPE

string homeassistant.components.ssdp.ATTR_UPNP_DEVICE_TYPE = "deviceType"

Definition at line 82 of file __init__.py.

◆ ATTR_UPNP_FRIENDLY_NAME

string homeassistant.components.ssdp.ATTR_UPNP_FRIENDLY_NAME = "friendlyName"

Definition at line 83 of file __init__.py.

◆ ATTR_UPNP_MANUFACTURER

string homeassistant.components.ssdp.ATTR_UPNP_MANUFACTURER = "manufacturer"

Definition at line 84 of file __init__.py.

◆ ATTR_UPNP_MANUFACTURER_URL

string homeassistant.components.ssdp.ATTR_UPNP_MANUFACTURER_URL = "manufacturerURL"

Definition at line 85 of file __init__.py.

◆ ATTR_UPNP_MODEL_DESCRIPTION

string homeassistant.components.ssdp.ATTR_UPNP_MODEL_DESCRIPTION = "modelDescription"

Definition at line 86 of file __init__.py.

◆ ATTR_UPNP_MODEL_NAME

string homeassistant.components.ssdp.ATTR_UPNP_MODEL_NAME = "modelName"

Definition at line 87 of file __init__.py.

◆ ATTR_UPNP_MODEL_NUMBER

string homeassistant.components.ssdp.ATTR_UPNP_MODEL_NUMBER = "modelNumber"

Definition at line 88 of file __init__.py.

◆ ATTR_UPNP_MODEL_URL

string homeassistant.components.ssdp.ATTR_UPNP_MODEL_URL = "modelURL"

Definition at line 89 of file __init__.py.

◆ ATTR_UPNP_PRESENTATION_URL

string homeassistant.components.ssdp.ATTR_UPNP_PRESENTATION_URL = "presentationURL"

Definition at line 94 of file __init__.py.

◆ ATTR_UPNP_SERIAL

string homeassistant.components.ssdp.ATTR_UPNP_SERIAL = "serialNumber"

Definition at line 90 of file __init__.py.

◆ ATTR_UPNP_SERVICE_LIST

string homeassistant.components.ssdp.ATTR_UPNP_SERVICE_LIST = "serviceList"

Definition at line 91 of file __init__.py.

◆ ATTR_UPNP_UDN

string homeassistant.components.ssdp.ATTR_UPNP_UDN = "UDN"

Definition at line 92 of file __init__.py.

◆ ATTR_UPNP_UPC

string homeassistant.components.ssdp.ATTR_UPNP_UPC = "UPC"

Definition at line 93 of file __init__.py.

◆ CONFIG_SCHEMA

homeassistant.components.ssdp.CONFIG_SCHEMA = cv.empty_config_schema(DOMAIN)

Definition at line 109 of file __init__.py.

◆ DOMAIN

string homeassistant.components.ssdp.DOMAIN = "ssdp"

Definition at line 60 of file __init__.py.

◆ IPV4_BROADCAST

homeassistant.components.ssdp.IPV4_BROADCAST = IPv4Address("255.255.255.255")

Definition at line 67 of file __init__.py.

◆ PRIMARY_MATCH_KEYS

list homeassistant.components.ssdp.PRIMARY_MATCH_KEYS
Initial value:
1 = [
2  ATTR_UPNP_MANUFACTURER,
3  ATTR_ST,
4  ATTR_UPNP_DEVICE_TYPE,
5  ATTR_NT,
6  ATTR_UPNP_MANUFACTURER_URL,
7 ]

Definition at line 98 of file __init__.py.

◆ SCAN_INTERVAL

homeassistant.components.ssdp.SCAN_INTERVAL = timedelta(minutes=10)

Definition at line 65 of file __init__.py.

◆ SSDP_SCANNER

string homeassistant.components.ssdp.SSDP_SCANNER = "scanner"

Definition at line 61 of file __init__.py.

◆ SsdpChange

homeassistant.components.ssdp.SsdpChange = Enum("SsdpChange", "ALIVE BYEBYE UPDATE")

Definition at line 129 of file __init__.py.

◆ SsdpHassJobCallback

homeassistant.components.ssdp.SsdpHassJobCallback

Definition at line 130 of file __init__.py.

◆ UPNP_SERVER

string homeassistant.components.ssdp.UPNP_SERVER = "server"

Definition at line 62 of file __init__.py.

◆ UPNP_SERVER_MAX_PORT

int homeassistant.components.ssdp.UPNP_SERVER_MAX_PORT = 40100

Definition at line 64 of file __init__.py.

◆ UPNP_SERVER_MIN_PORT

int homeassistant.components.ssdp.UPNP_SERVER_MIN_PORT = 40000

Definition at line 63 of file __init__.py.