Skip to content

Commit

Permalink
Correctly type the SSDP callback function (home-assistant#60964)
Browse files Browse the repository at this point in the history
  • Loading branch information
balloob authored Dec 4, 2021
1 parent 7fbe1db commit b8071c6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions homeassistant/components/yeelight/scanner.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import logging
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.components import network, ssdp
Expand Down Expand Up @@ -174,10 +174,9 @@ def _async_start_flow(*_):
# of another discovery
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."""
_LOGGER.debug("Discovered via SSDP: %s", response)
headers = response.ssdp_headers
_LOGGER.debug("Discovered via SSDP: %s", headers)
unique_id = headers["id"]
host = urlparse(headers["location"]).hostname
current_entry = self._unique_id_capabilities.get(unique_id)
Expand Down

0 comments on commit b8071c6

Please sign in to comment.