Skip to content

Commit

Permalink
dial: Don't attempt resolve if zeroconf loop isn't running
Browse files Browse the repository at this point in the history
zeroconf asserts that the loop is running, so if we call this function
without the loop running, it will hit the assert.

Closes home-assistant-libs#641.
  • Loading branch information
soreau committed Jul 2, 2022
1 parent e32fa90 commit f625690
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pychromecast/dial.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ def get_host_from_service(service, zconf):
return service.data + (None,)

try:
service_info = zconf.get_service_info("_googlecast._tcp.local.", service.data)
if zconf.loop.is_running():
service_info = zconf.get_service_info("_googlecast._tcp.local.", service.data)
if service_info:
_LOGGER.debug(
"get_info_from_service resolved service %s to service_info %s",
Expand Down

0 comments on commit f625690

Please sign in to comment.