From d1170cec09c96baf997affa6cf5e5d35ccbc8ce7 Mon Sep 17 00:00:00 2001 From: Erik Date: Sun, 31 May 2020 11:18:40 +0200 Subject: [PATCH] Support zeroconf 0.27 --- pychromecast/discovery.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pychromecast/discovery.py b/pychromecast/discovery.py index 366fe734d..c87eed150 100644 --- a/pychromecast/discovery.py +++ b/pychromecast/discovery.py @@ -176,10 +176,10 @@ def get_host_from_service_info(service_info): if ( service_info and service_info.port - and (service_info.server or service_info.address) + and (service_info.server or len(service_info.addresses) > 0) ): - if service_info.address: - host = socket.inet_ntoa(service_info.address) + if len(service_info.addresses) > 0: + host = socket.inet_ntoa(service_info.addresses[0]) else: host = service_info.server.lower() port = service_info.port