From 33ff98c2c65431385264941c67b91a5d9dc6da2f Mon Sep 17 00:00:00 2001 From: Max Prokhorov Date: Thu, 9 Jul 2020 00:51:36 +0300 Subject: [PATCH] ota.py: don't use deprecated zeroconf attrs (#2299) Also bump zeroconf to the version used by PIO --- code/ota.py | 6 ++++-- code/requirements.txt | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/code/ota.py b/code/ota.py index 3541fcbb..21681a62 100755 --- a/code/ota.py +++ b/code/ota.py @@ -22,7 +22,7 @@ import zeroconf # ------------------------------------------------------------------------------- -__version__ = (0, 4, 1) +__version__ = (0, 4, 2) DESCRIPTION = "ESPurna OTA Manager v{}".format(".".join(str(x) for x in __version__)) DISCOVERY_TIMEOUT = 10 @@ -113,9 +113,11 @@ class Listener: return hostname = info.server.split(".")[0] + addresses = info.parsed_addresses() + device = { "hostname": hostname.upper(), - "ip": socket.inet_ntoa(info.address), + "ip": addresses[0] if addresses else info.host, "mac": "", "app_name": "", "app_version": "", diff --git a/code/requirements.txt b/code/requirements.txt index 3ae32d20..9308059e 100644 --- a/code/requirements.txt +++ b/code/requirements.txt @@ -1,2 +1,2 @@ ifaddr==0.1.6 -zeroconf==0.24.0 +zeroconf==0.26.0