mirror of
https://github.com/home-assistant/core.git
synced 2025-07-15 17:27:10 +00:00
Correctly type the SSDP callback function (#60964)
This commit is contained in:
parent
7fbe1dbc99
commit
b8071c688b
@ -7,7 +7,7 @@ from ipaddress import IPv4Address, IPv6Address
|
|||||||
import logging
|
import logging
|
||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
|
|
||||||
from async_upnp_client.search import SsdpSearchListener
|
from async_upnp_client.search import SsdpHeaders, SsdpSearchListener
|
||||||
|
|
||||||
from homeassistant import config_entries
|
from homeassistant import config_entries
|
||||||
from homeassistant.components import network, ssdp
|
from homeassistant.components import network, ssdp
|
||||||
@ -174,10 +174,9 @@ class YeelightScanner:
|
|||||||
# of another discovery
|
# of another discovery
|
||||||
async_call_later(self._hass, 1, _async_start_flow)
|
async_call_later(self._hass, 1, _async_start_flow)
|
||||||
|
|
||||||
async def _async_process_entry(self, response: ssdp.SsdpServiceInfo):
|
async def _async_process_entry(self, headers: SsdpHeaders):
|
||||||
"""Process a discovery."""
|
"""Process a discovery."""
|
||||||
_LOGGER.debug("Discovered via SSDP: %s", response)
|
_LOGGER.debug("Discovered via SSDP: %s", headers)
|
||||||
headers = response.ssdp_headers
|
|
||||||
unique_id = headers["id"]
|
unique_id = headers["id"]
|
||||||
host = urlparse(headers["location"]).hostname
|
host = urlparse(headers["location"]).hostname
|
||||||
current_entry = self._unique_id_capabilities.get(unique_id)
|
current_entry = self._unique_id_capabilities.get(unique_id)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user