seveas / python-networkmanager

Easy communication with NetworkManager
http://packages.python.org/python-networkmanager/
Other
163 stars 90 forks source link

Registering on device OnPropertiesChanged signal, register on the wrong interface. #74

Closed yoavmarom closed 1 year ago

yoavmarom commented 5 years ago

After registering on a device, obtained using GetDevices function, the key on which the callback is registered is: ('org.freedesktop.NetworkManager.Device.Statistics', 'PropertiesChanged') While it should be ('org.freedesktop.NetworkManager.Device', 'PropertiesChanged')

Example: In [1]: import NetworkManager In [2]: NetworkManager.NetworkManager.GetDevices() Out[2]: [<NetworkManager.Modem at 0x7f4a8b3c1710>] In[3]: device = NetworkManager.NetworkManager.GetDevices()[0] In[4]: device.OnPropertiesChanged(lambda:None)

yoavmarom commented 5 years ago

The root cause of the change is this line:

gfrung4 commented 5 years ago

I just ran into this issue too. It seems to have been introduced in this commit nearly 2 years ago.

https://github.com/seveas/python-networkmanager/commit/c92cbd936da35cf9c9654db0d533e4775912af76

Removing org.freedesktop.NetworkManager.Device.Statistics from that list seems to fix it. I wonder why it was added in the first place?

seveas commented 1 year ago

Closing all PR's and issues prior to archiving this repository.