Skip to content

Commit

Permalink
Find NM PANU connection by bdaddr
Browse files Browse the repository at this point in the history
...not device name.

Fixes blueman-project#1819
  • Loading branch information
cschramm committed Aug 15, 2022
1 parent 2f88e18 commit b524334
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@
* Store network configuration in GSettings instead of /var/lib/blueman/network.state.
* Replace custom MessageArea widget with regular Gtk.InfoBar

### Bugs fixed

* Issues with NM PANU connections of equally named devices

## 2.3.1

### Bugs fixed
Expand Down
11 changes: 6 additions & 5 deletions blueman/main/NetworkManager.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,12 +161,13 @@ def store_uuid(self, conn_uuid: str) -> None:
@property
def connection_uuid(self) -> str:
# PANU connections are automatically created so attempt to find it
# It appears the Name property is used not Alias!
conn = self.client.get_connection_by_id(f"{self.device['Name']} Network")
res: str
if conn is not None:
conn_settings = conn.get_setting_connection()
res = conn_settings.get_uuid()
for conn in self.client.get_connections():
bluetooth_setting = conn.get_setting_bluetooth()
if bluetooth_setting is not None and bluetooth_setting.get_bdaddr() == self.bdaddr:
conn_settings = conn.get_setting_connection()
res = conn_settings.get_uuid()
break
else:
res = self.Config['nmpanuuid']
return res
Expand Down

0 comments on commit b524334

Please sign in to comment.