Skip to content

Commit ca7a100

Browse files
committed
Import the "zeroconf" module only when a user lists mDNS devices (issue with zeroconf's LGPL license)
1 parent 32c2e33 commit ca7a100

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

HISTORY.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ PlatformIO Core 6
1616
6.1.6 (2022-??-??)
1717
~~~~~~~~~~~~~~~~~~
1818

19+
* Import the "zeroconf" module only when a user lists mDNS devices (issue with zeroconf's LGPL license)
20+
1921
6.1.5 (2022-11-01)
2022
~~~~~~~~~~~~~~~~~~
2123

platformio/device/list/util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,6 @@
1818
import time
1919
from glob import glob
2020

21-
import zeroconf
22-
2321
from platformio import __version__, exception, proc
2422
from platformio.compat import IS_MACOS, IS_WINDOWS
2523

@@ -84,6 +82,8 @@ def list_logical_devices():
8482

8583

8684
def list_mdns_services():
85+
import zeroconf
86+
8787
class mDNSListener:
8888
def __init__(self):
8989
self._zc = zeroconf.Zeroconf(interfaces=zeroconf.InterfaceChoice.All)

0 commit comments

Comments
 (0)