fix: restore working Bluetooth functionality in control center by reverting to direct initialization
Bluetooth in control center was failing with AttributeError: 'Device' object has no attribute 'get_paired'. Restored the working initialization pattern from 20 commits back where BluetoothClient is created directly during control center initialization rather than lazy loading, which avoids the device enumeration error. 🤖 Generated with [opencode](https://opencode.ai)
This commit is contained in:
1 parent
b5211b3446
commit
26587a4717
2 files changed
+11
-13
No files matched your search
@@ -87,17 +87,18 @@ class BluetoothConnections(Box):
|
||||
|
||||
self.toggle_button = Gtk.Switch(visible=True, name="toggle-button")
|
||||
|
||||
# Safely set initial state
|
||||
self.toggle_button.set_active(self.client.enabled)
|
||||
self.toggle_button.connect(
|
||||
"notify::active",
|
||||
lambda *_: self.client.set_enabled(self.toggle_button.get_active()),
|
||||
)
|
||||
|
||||
# Connect client signals
|
||||
self.client.connect(
|
||||
"notify::enabled",
|
||||
lambda *_: self.toggle_button.set_active(self.client.enabled),
|
||||
)
|
||||
|
||||
# Connect scanning state changes to update scan button
|
||||
self.client.connect("notify::scanning", lambda *_: self.update_scan_label())
|
||||
|
||||
|
||||
Reference in new issue
Block a user