ip change is async

This commit is contained in:
j 2024-06-13 13:31:15 +01:00
parent 7b826468d8
commit 761f973895

View file

@ -72,11 +72,11 @@ class LocalNodes(dict):
asyncio.create_task(self.register_service())
self.browse()
def _update_if_ip_changed(self):
async def _update_if_ip_changed(self):
local_ips = get_broadcast_interfaces()
username = settings.preferences.get('username', 'anonymous')
if local_ips != self.local_ips or self.username != username:
asyncio.run(self.close())
await self.close()
self.setup()
def browse(self):