diff --git a/lib/logitech_receiver/device.py b/lib/logitech_receiver/device.py index 2316b977..17baf770 100644 --- a/lib/logitech_receiver/device.py +++ b/lib/logitech_receiver/device.py @@ -94,6 +94,7 @@ class Device: self._profiles = self._backlight = self._registers = self._settings = None self.notification_flags = None self.battery_info = None + self.link_encrypted = None self._feature_settings_checked = False self._gestures_lock = _threading.Lock() @@ -361,7 +362,6 @@ class Device: info.level = self.battery_info.level changed = self.battery_info != info - print("SBI", changed, info, self.battery_info) self.battery_info, old_info = info, self.battery_info alert, reason = ALERT.NONE, None diff --git a/lib/logitech_receiver/notifications.py b/lib/logitech_receiver/notifications.py index a909ffe8..fbdb7e15 100644 --- a/lib/logitech_receiver/notifications.py +++ b/lib/logitech_receiver/notifications.py @@ -266,7 +266,7 @@ def _process_hidpp10_notification(device, status, n): link_established, bool(flags & 0x80), ) - status.link_encrypted = link_encrypted + device.link_encrypted = link_encrypted status.changed(active=link_established) return True diff --git a/lib/logitech_receiver/status.py b/lib/logitech_receiver/status.py index 59b03f84..6c98f342 100644 --- a/lib/logitech_receiver/status.py +++ b/lib/logitech_receiver/status.py @@ -68,7 +68,6 @@ class DeviceStatus: assert changed_callback self._changed_callback = changed_callback self._active = None # is the device active? - self.link_encrypted = None def __bool__(self): return bool(self._active) diff --git a/lib/solaar/ui/pair_window.py b/lib/solaar/ui/pair_window.py index c90bd3c5..5e8e2256 100644 --- a/lib/solaar/ui/pair_window.py +++ b/lib/solaar/ui/pair_window.py @@ -232,7 +232,7 @@ def _pairing_succeeded(assistant, receiver, device): def _check_encrypted(dev): if assistant.is_drawable(): - if device.status.link_encrypted is False: + if device.link_encrypted is False: hbox.pack_start(Gtk.Image.new_from_icon_name("security-low", Gtk.IconSize.MENU), False, False, 0) hbox.pack_start(Gtk.Label(_("The wireless link is not encrypted") + "!"), False, False, 0) hbox.show_all() diff --git a/lib/solaar/ui/window.py b/lib/solaar/ui/window.py index 6ae2e681..bac0442d 100644 --- a/lib/solaar/ui/window.py +++ b/lib/solaar/ui/window.py @@ -725,12 +725,12 @@ def _update_device_panel(device, panel, buttons, full=False): panel._battery._text.set_markup(text) panel._battery.set_tooltip_text(tooltip_text) - if device.status.link_encrypted is None: + if device.link_encrypted is None: panel._secure.set_visible(False) elif is_online: panel._secure.set_visible(True) panel._secure._icon.set_visible(True) - if device.status.link_encrypted is True: + if device.link_encrypted is True: panel._secure._text.set_text(_("encrypted")) panel._secure._icon.set_from_icon_name("security-high", _INFO_ICON_SIZE) panel._secure.set_tooltip_text(_("The wireless link between this device and its receiver is encrypted."))