Fix Network panel not functioning when Wi-Fi point is within range () ()

This commit is contained in:
Vladimir Poleh 2021-11-02 05:51:41 +03:00 committed by GitHub
parent e7e91aee27
commit c7901243cf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -33,8 +33,11 @@ class NetworkPanel(ScreenPanel):
else: else:
ints = netifaces.interfaces() ints = netifaces.interfaces()
if 'lo' in ints: if 'lo' in ints:
ints.pop('lo') ints.pop(ints.index('lo'))
self.interfaces = ints[0] if (len(ints) > 0):
self.interface = ints[0]
else:
self.interface = 'lo'
res = netifaces.ifaddresses(self.interface) res = netifaces.ifaddresses(self.interface)
if netifaces.AF_INET in res and len(res[netifaces.AF_INET]) > 0: if netifaces.AF_INET in res and len(res[netifaces.AF_INET]) > 0: