Closed ObiWanLansi closed 3 years ago
As the method names are the same, FritzWLAN inspects the active devices for a single service (2.4 GHz, 5 GHz or the guest network). FritzHosts instead inspects all known devices, regardless whether they are active or inactive or connected by LAN or WLAN. Therefore you get different informations.
To get the host informations from all active devices connected via WLAN, FritzWLAN has to iterate over the services, i.e.:
from itertools import count
import fritzconnection
from fritzconnection.core.exceptions import FritzServiceError
from fritzconnection.lib.fritzwlan import FritzWLAN
fc = fritzconnection.FritzConnection(address='x.x.x.x', password='the_password')
for service in count(1):
# example to reuse fc once it's instanciated:
fw = FritzWLAN(fc, service=service)
try:
print(fw.get_hosts_info())
except FritzServiceError:
break
Ahhh, i belive i understand now, the Network is an parameter at FritzWLAN, and 2.4GHz is the default value, so it works for me fine. But when i want to have also the 5GHz devices, i muss add this parameter. I'll try again :-) .
Thnx
Hi everybody,
i've a problem with the
get_hosts_info()
function fromFritzWLAN
, this function only returns the 2.4 GHz devices, but not the 5GHz devices.But the function
get_hosts_info()
fromFritzHosts
return all WLan devices (but without some properties like signal and speed).Have somebody else the same issue or an solution ?
Thnx, ObiWanLansi