home-assistant-libs / netdisco

:mag_right: Python library to scan local network for services and devices.
Other
268 stars 147 forks source link

Remove netifaces lib reference #215

Closed awarecan closed 6 years ago

awarecan commented 6 years ago

Since 0.21.0, zeroconf replaced the usage of netifaces by ifaddr

Use zeroconf.interface_addresses to replace util.interface_addresses method. So that we can remove the depends of netifaces lib

fixes #214

Need help to test on real device supports SSDP protocol.

jaharkes commented 6 years ago

This change broke discovery for me, I am seeing the following traceback.

2018-09-23 23:55:54 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/discovery.py", line 168, in scan_devices
    results = await hass.async_add_job(_discover, netdisco)
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/discovery.py", line 194, in _discover
    netdisco.scan()
  File "/usr/local/lib/python3.6/site-packages/netdisco/discovery.py", line 57, in scan
    self.ssdp.scan()
  File "/usr/local/lib/python3.6/site-packages/netdisco/ssdp.py", line 41, in scan
    self.update()
  File "/usr/local/lib/python3.6/site-packages/netdisco/ssdp.py", line 89, in update
    entry for entry in scan()
  File "/usr/local/lib/python3.6/site-packages/netdisco/ssdp.py", line 225, in scan
    for addr in zeroconf.get_all_addresses():
TypeError: get_all_addresses() missing 1 required positional argument: 'address_family'
balloob commented 6 years ago

Fixed in 0.78.3 👍